|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.smartgwt.client.widgets.BaseWidget
com.smartgwt.client.widgets.Canvas
com.smartgwt.client.widgets.layout.Layout
com.smartgwt.client.widgets.form.FilterBuilder
public class FilterBuilder
A form that allows the user to input advanced search criteria, including operators on field values such as "less than", and sub-clauses using "AND" and "OR" operators.
A FilterBuilder produces an AdvancedCriteria object, which the DataSource subsystem can
use to filter datasets, including the ability to perform such filtering within the browser for datasets that are
completely loaded.
The operators available for each field can be customized at the DataSource level via validOperators, DataSource.setTypeOperators and related APIs.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled |
| Field Summary |
|---|
| Fields inherited from class com.smartgwt.client.widgets.BaseWidget |
|---|
config, configOnly, id, isElementSet, nativeObject, scClassName |
| Fields inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
DEBUG_ID_PREFIX |
| Constructor Summary | |
|---|---|
FilterBuilder()
|
|
FilterBuilder(com.google.gwt.core.client.JavaScriptObject jsObj)
|
|
| Method Summary | |
|---|---|
void |
addClause(FilterClause filterClause)
Add a new FilterClause to this FilterBuilder. |
void |
addCriterion(Criterion criterion)
Add a new criterion, including recursively adding sub-criteria for a criterion that contains other criteria. |
com.google.gwt.event.shared.HandlerRegistration |
addFilterChangedHandler(FilterChangedHandler handler)
Add a filterChanged handler. |
com.google.gwt.event.shared.HandlerRegistration |
addSearchHandler(SearchHandler handler)
Add a search handler. |
void |
clearCriteria()
Clear all current criteria. |
protected static FilterClause[] |
convertToFilterClauseArray(com.google.gwt.core.client.JavaScriptObject nativeArray)
|
protected com.google.gwt.core.client.JavaScriptObject |
create()
|
java.lang.String |
getAddButtonPrompt()
The hover prompt text for the add button. |
java.lang.Boolean |
getAllowEmpty()
If set to false, the last clause cannot be removed. |
AdvancedCriteria |
getCriteria()
Get the edited criteria entered by the user. |
AdvancedCriteria |
getCriteria(boolean includeEmptyValues)
Get the edited criteria entered by the user. |
DataSource |
getDataSource()
The DataSource that this component should bind to for default fields and for performing DSRequest. |
java.lang.String |
getEditorType(DataSourceField field,
OperatorId operatorId)
Returns the type of editor to use for the field. |
DataSource |
getFieldDataSource()
If specified, the FilterBuilder will dynamically fetch DataSourceField definitions from this DataSource rather than using dataSource. |
FormItem |
getFieldPickerProperties()
Properties to combine with the fieldPicker
autoChild FormItem. |
java.lang.String |
getFieldPickerTitle()
The title for the field-picker select-item. |
java.lang.String |
getInlineAndNotTitle()
Title for the "And Not" operator (only applicable to the "inline" appearance) |
java.lang.String |
getInlineAndTitle()
Title for the "And" operator (only applicable to the "inline" appearance) |
java.lang.String |
getInlineOrTitle()
Title for the "Or" operator (only applicable to the "inline" appearance) |
com.smartgwt.logicalstructure.core.LogicalStructureObject |
getLogicalStructure()
|
java.lang.String |
getMatchAllTitle()
Title for the "Match All" (and) operator when using topOperatorAppearance:"radio". |
java.lang.String |
getMatchAnyTitle()
Title for the "Match Any" (or) operator when using topOperatorAppearance:"radio". |
java.lang.String |
getMatchNoneTitle()
Title for the "Match None" (not) operator when using topOperatorAppearance:"radio". |
Canvas[] |
getMembers()
Return the members in the Layout. |
java.lang.String |
getMissingFieldPrompt()
The message to display next to fieldNames that do not exist in the available dataSource. |
java.lang.String |
getOperatorPickerTitle()
The title for the operator-picker select-item. |
static FilterBuilder |
getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)
|
java.lang.String |
getRadioOperatorTitle()
The title for the Operator RadioGroupItem displayed in the radioOperatorForm. |
java.lang.String |
getRangeSeparator()
For operators that check that a value is within a range, text to show between the start and end input fields for specifying the limits of the range. |
java.lang.String |
getRemoveButtonPrompt()
The hover prompt text for the remove button. |
java.lang.Boolean |
getRetainValuesAcrossFields()
Dictates whether values entered by a user should be retained in the value fields when a different field is selected. |
java.lang.Boolean |
getSaveOnEnter()
If true, when the user hits the Enter key while focused in a text-item in this FilterBuilder, we automatically invoke the user-supplied FilterBuilder.search method. |
FilterClause[] |
getSelectedClauses()
Returns the list of this FilterBuilder's FilterClauses that are currently selected. |
java.lang.Boolean |
getShowAddButton()
If set, a button will be shown underneath all current clauses allowing a new clause to be added. |
java.lang.Boolean |
getShowFieldTitles()
If true (the default), show field titles in the drop-down box used to select a field for querying. |
java.lang.Boolean |
getShowRemoveButton()
If set, a button will be shown for each clause allowing it to be removed. |
java.lang.Boolean |
getShowSelectionCheckbox()
If true, causes a CheckboxItem to appear to the left of each clause in "inline" appearance. |
java.lang.Boolean |
getShowSubClauseButton()
Whether to show a button that allows the user to add subclauses. |
java.lang.Boolean |
getSortFields()
Should the fieldPicker items be sorted
alphabetically in the drop down list. |
java.lang.String |
getSubClauseButtonPrompt()
The hover prompt text for the subClauseButton. |
java.lang.String |
getSubClauseButtonTitle()
The title of the subClauseButton |
LogicalOperator |
getTopOperator()
Default logical operator for all top-level clauses in the FilterBuilder. |
java.lang.String |
getTopOperatorTitle()
The title for the left-aligned Operator selectItem in the topOperatorForm. |
java.lang.Boolean |
getValidateOnChange()
If true (the default), validates each entered value when it changes, to make sure it is a a valid value of its type (valid string, number, and so on). |
FormItem |
getValueFieldProperties(FieldType type,
java.lang.String fieldName,
OperatorId operatorId,
ValueItemType itemType,
java.lang.String fieldType)
Override to return properties for the FormItem(s) used for the "value" field displayed within clauses within this filterBuilder. |
protected void |
onInit_FilterBuilder()
|
void |
onInit()
|
void |
removeClause(FilterClause clause)
Remove a clause this FilterBuilder is currently showing. |
void |
setAddButtonPrompt(java.lang.String addButtonPrompt)
The hover prompt text for the add button. |
void |
setAllowEmpty(java.lang.Boolean allowEmpty)
If set to false, the last clause cannot be removed. |
void |
setCriteria(AdvancedCriteria criteria)
Initial criteria. |
void |
setDataSource(DataSource dataSource)
DataSource this filter should use for field definitions and available ${isc.DocUtils.linkForRef('object:Operator')}s. |
static void |
setDefaultProperties(FilterBuilder filterBuilderProperties)
Class level method to set the default properties of this class. |
void |
setFieldDataSource(DataSource fieldDataSource)
If specified, the FilterBuilder will dynamically fetch DataSourceField definitions from this DataSource rather than using dataSource. |
void |
setFieldPickerProperties(FormItem fieldPickerProperties)
Properties to combine with the fieldPicker
autoChild FormItem. |
void |
setFieldPickerTitle(java.lang.String fieldPickerTitle)
The title for the field-picker select-item. |
void |
setInlineAndNotTitle(java.lang.String inlineAndNotTitle)
Title for the "And Not" operator (only applicable to the "inline" appearance) |
void |
setInlineAndTitle(java.lang.String inlineAndTitle)
Title for the "And" operator (only applicable to the "inline" appearance) |
void |
setInlineOrTitle(java.lang.String inlineOrTitle)
Title for the "Or" operator (only applicable to the "inline" appearance) |
void |
setJavaScriptObject(com.google.gwt.core.client.JavaScriptObject jsObj)
|
com.smartgwt.logicalstructure.core.LogicalStructureObject |
setLogicalStructure(com.smartgwt.logicalstructure.widgets.form.FilterBuilderLogicalStructure s)
|
void |
setMatchAllTitle(java.lang.String matchAllTitle)
Title for the "Match All" (and) operator when using topOperatorAppearance:"radio". |
void |
setMatchAnyTitle(java.lang.String matchAnyTitle)
Title for the "Match Any" (or) operator when using topOperatorAppearance:"radio". |
void |
setMatchNoneTitle(java.lang.String matchNoneTitle)
Title for the "Match None" (not) operator when using topOperatorAppearance:"radio". |
void |
setMissingFieldPrompt(java.lang.String missingFieldPrompt)
The message to display next to fieldNames that do not exist in the available dataSource. |
void |
setOperatorPickerTitle(java.lang.String operatorPickerTitle)
The title for the operator-picker select-item. |
void |
setRadioOperatorTitle(java.lang.String radioOperatorTitle)
The title for the Operator RadioGroupItem displayed in the radioOperatorForm. |
void |
setRangeSeparator(java.lang.String rangeSeparator)
For operators that check that a value is within a range, text to show between the start and end input fields for specifying the limits of the range. |
void |
setRemoveButtonPrompt(java.lang.String removeButtonPrompt)
The hover prompt text for the remove button. |
void |
setRetainValuesAcrossFields(java.lang.Boolean retainValuesAcrossFields)
Dictates whether values entered by a user should be retained in the value fields when a different field is selected. |
void |
setSaveOnEnter(java.lang.Boolean saveOnEnter)
If true, when the user hits the Enter key while focused in a text-item in this FilterBuilder, we automatically invoke the user-supplied FilterBuilder.search method. |
void |
setShowAddButton(java.lang.Boolean showAddButton)
If set, a button will be shown underneath all current clauses allowing a new clause to be added. |
void |
setShowFieldTitles(boolean showFieldTitles)
If true (the default), show field titles in the drop-down box used to select a field for querying. |
void |
setShowFieldTitles(java.lang.Boolean showFieldTitles)
If true (the default), show field titles in the drop-down box used to select a field for querying. |
void |
setShowRemoveButton(java.lang.Boolean showRemoveButton)
If set, a button will be shown for each clause allowing it to be removed. |
void |
setShowSelectionCheckbox(java.lang.Boolean showSelectionCheckbox)
If true, causes a CheckboxItem to appear to the left of each clause in "inline" appearance. |
void |
setShowSubClauseButton(java.lang.Boolean showSubClauseButton)
Whether to show a button that allows the user to add subclauses. |
void |
setSortFields(java.lang.Boolean sortFields)
Should the fieldPicker items be sorted
alphabetically in the drop down list. |
void |
setSubClauseButtonPrompt(java.lang.String subClauseButtonPrompt)
The hover prompt text for the subClauseButton. |
void |
setSubClauseButtonTitle(java.lang.String subClauseButtonTitle)
The title of the subClauseButton |
void |
setTopOperator(LogicalOperator topOperator)
Default logical operator for all top-level clauses in the FilterBuilder. |
void |
setTopOperatorAppearance(TopOperatorAppearance topOperatorAppearance)
How to display and edit the topOperator for
this FilterBuilder. |
void |
setTopOperatorTitle(java.lang.String topOperatorTitle)
The title for the left-aligned Operator selectItem in the topOperatorForm. |
void |
setValidateOnChange(java.lang.Boolean validateOnChange)
If true (the default), validates each entered value when it changes, to make sure it is a a valid value of its type (valid string, number, and so on). |
java.lang.Boolean |
validate()
Validate the clauses of this FilterBuilder. |
| Methods inherited from class com.google.gwt.user.client.ui.Widget |
|---|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, getLayoutData, getParent, isAttached, isOrWasAttached, onBrowserEvent, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents |
| Methods inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
addStyleDependentName, ensureDebugId, ensureDebugId, ensureDebugId, getStyleElement, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkBitlessEvent, unsinkEvents |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
|---|
fireEvent |
| Constructor Detail |
|---|
public FilterBuilder()
public FilterBuilder(com.google.gwt.core.client.JavaScriptObject jsObj)
| Method Detail |
|---|
public static FilterBuilder getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)
public void setJavaScriptObject(com.google.gwt.core.client.JavaScriptObject jsObj)
setJavaScriptObject in class Layoutprotected com.google.gwt.core.client.JavaScriptObject create()
create in class Layout
public void setAddButtonPrompt(java.lang.String addButtonPrompt)
throws java.lang.IllegalStateException
addButtonPrompt - . See String. Default value is "Add"
java.lang.IllegalStateException - this property cannot be changed after the component has been createdpublic java.lang.String getAddButtonPrompt()
String
public void setAllowEmpty(java.lang.Boolean allowEmpty)
throws java.lang.IllegalStateException
allowEmpty - allowEmpty Default value is false
java.lang.IllegalStateException - this property cannot be changed after the component has been createdpublic java.lang.Boolean getAllowEmpty()
public void setFieldDataSource(DataSource fieldDataSource)
throws java.lang.IllegalStateException
dataSource. The fieldPicker will default to being a ComboBoxItem rather than a SelectItem so that the user will have type-ahead auto-completion. The
records returned from the fieldDataSource must have properties corresponding to a DataSourceField definition, at a minimum, "name" and "type". Any property legal on a DataSourceField is legal on the returned records, including valueMap.
Even when a fieldDataSource is
specified, dataSource may still be specified in
order to control the list of valid operators for each
field.
fieldDataSource - fieldDataSource Default value is null
java.lang.IllegalStateException - this property cannot be changed after the component has been createdpublic DataSource getFieldDataSource()
dataSource. The fieldPicker will default to being a ComboBoxItem rather than a SelectItem so that the user will have type-ahead auto-completion. The
records returned from the fieldDataSource must have properties corresponding to a DataSourceField definition, at a minimum, "name" and "type". Any property legal on a DataSourceField is legal on the returned records, including valueMap.
Even when a fieldDataSource is
specified, dataSource may still be specified in
order to control the list of valid operators for each
field.
public void setFieldPickerProperties(FormItem fieldPickerProperties)
throws java.lang.IllegalStateException
fieldPicker
autoChild FormItem.
fieldPickerProperties - fieldPickerProperties Default value is null
java.lang.IllegalStateException - this property cannot be changed after the component has been createdpublic FormItem getFieldPickerProperties()
fieldPicker
autoChild FormItem.
public void setFieldPickerTitle(java.lang.String fieldPickerTitle)
throws java.lang.IllegalStateException
field-picker select-item.
fieldPickerTitle - . See String. Default value is "Field Name"
java.lang.IllegalStateException - this property cannot be changed after the component has been createdpublic java.lang.String getFieldPickerTitle()
field-picker select-item.
String
public void setInlineAndNotTitle(java.lang.String inlineAndNotTitle)
throws java.lang.IllegalStateException
inlineAndNotTitle - . See String. Default value is "and not"
java.lang.IllegalStateException - this property cannot be changed after the component has been createdpublic java.lang.String getInlineAndNotTitle()
String
public void setInlineAndTitle(java.lang.String inlineAndTitle)
throws java.lang.IllegalStateException
inlineAndTitle - . See String. Default value is "and"
java.lang.IllegalStateException - this property cannot be changed after the component has been createdpublic java.lang.String getInlineAndTitle()
String
public void setInlineOrTitle(java.lang.String inlineOrTitle)
throws java.lang.IllegalStateException
inlineOrTitle - . See String. Default value is "or"
java.lang.IllegalStateException - this property cannot be changed after the component has been createdpublic java.lang.String getInlineOrTitle()
String
public void setMatchAllTitle(java.lang.String matchAllTitle)
throws java.lang.IllegalStateException
topOperatorAppearance:"radio".
matchAllTitle - . See String. Default value is "Match All"
java.lang.IllegalStateException - this property cannot be changed after the component has been createdpublic java.lang.String getMatchAllTitle()
topOperatorAppearance:"radio".
String
public void setMatchAnyTitle(java.lang.String matchAnyTitle)
throws java.lang.IllegalStateException
topOperatorAppearance:"radio".
matchAnyTitle - . See String. Default value is "Match Any"
java.lang.IllegalStateException - this property cannot be changed after the component has been createdpublic java.lang.String getMatchAnyTitle()
topOperatorAppearance:"radio".
String
public void setMatchNoneTitle(java.lang.String matchNoneTitle)
throws java.lang.IllegalStateException
topOperatorAppearance:"radio".
matchNoneTitle - . See String. Default value is "Match None"
java.lang.IllegalStateException - this property cannot be changed after the component has been createdpublic java.lang.String getMatchNoneTitle()
topOperatorAppearance:"radio".
String
public void setMissingFieldPrompt(java.lang.String missingFieldPrompt)
throws java.lang.IllegalStateException
missingFieldPrompt - . See String. Default value is "[missing field definition]"
java.lang.IllegalStateException - this property cannot be changed after the component has been createdpublic java.lang.String getMissingFieldPrompt()
String
public void setOperatorPickerTitle(java.lang.String operatorPickerTitle)
throws java.lang.IllegalStateException
operatorPickerTitle - . See String. Default value is "Operator"
java.lang.IllegalStateException - this property cannot be changed after the component has been createdpublic java.lang.String getOperatorPickerTitle()
String
public void setRadioOperatorTitle(java.lang.String radioOperatorTitle)
throws java.lang.IllegalStateException
radioOperatorForm.
radioOperatorTitle - . See String. Default value is "Overall Operator"
java.lang.IllegalStateException - this property cannot be changed after the component has been createdpublic java.lang.String getRadioOperatorTitle()
radioOperatorForm.
String
public void setRangeSeparator(java.lang.String rangeSeparator)
throws java.lang.IllegalStateException
rangeSeparator - . See String. Default value is "and"
java.lang.IllegalStateException - this property cannot be changed after the component has been createdpublic java.lang.String getRangeSeparator()
String
public void setRemoveButtonPrompt(java.lang.String removeButtonPrompt)
throws java.lang.IllegalStateException
removeButtonPrompt - . See String. Default value is "Remove"
java.lang.IllegalStateException - this property cannot be changed after the component has been createdpublic java.lang.String getRemoveButtonPrompt()
Stringpublic void setRetainValuesAcrossFields(java.lang.Boolean retainValuesAcrossFields)
Note that, when switching between fields that have an optionDataSource or valueMap, this property is ignored and the values are never retained.
retainValuesAcrossFields - retainValuesAcrossFields Default value is truepublic java.lang.Boolean getRetainValuesAcrossFields()
Note that, when switching between fields that have an optionDataSource or valueMap, this property is ignored and the values are never retained.
public void setSaveOnEnter(java.lang.Boolean saveOnEnter)
throws java.lang.IllegalStateException
FilterBuilder.search method.
saveOnEnter - saveOnEnter Default value is null
java.lang.IllegalStateException - this property cannot be changed after the component has been createdpublic java.lang.Boolean getSaveOnEnter()
FilterBuilder.search method.
public void setShowAddButton(java.lang.Boolean showAddButton)
throws java.lang.IllegalStateException
showAddButton - showAddButton Default value is true
java.lang.IllegalStateException - this property cannot be changed after the component has been createdpublic java.lang.Boolean getShowAddButton()
public void setShowFieldTitles(java.lang.Boolean showFieldTitles)
throws java.lang.IllegalStateException
showFieldTitles - showFieldTitles Default value is true
java.lang.IllegalStateException - this property cannot be changed after the component has been createdpublic java.lang.Boolean getShowFieldTitles()
public void setShowRemoveButton(java.lang.Boolean showRemoveButton)
throws java.lang.IllegalStateException
showRemoveButton - showRemoveButton Default value is true
java.lang.IllegalStateException - this property cannot be changed after the component has been createdpublic java.lang.Boolean getShowRemoveButton()
public void setShowSelectionCheckbox(java.lang.Boolean showSelectionCheckbox)
throws java.lang.IllegalStateException
appearance. This checkbox allows the user to select individual
clauses so that, for example, clauses can be removed from the filterBuilder by application code. This property is
ignored for appearances other than "inline".
showSelectionCheckbox - showSelectionCheckbox Default value is false
java.lang.IllegalStateException - this property cannot be changed after the component has been createdpublic java.lang.Boolean getShowSelectionCheckbox()
appearance. This checkbox allows the user to select individual
clauses so that, for example, clauses can be removed from the filterBuilder by application code. This property is
ignored for appearances other than "inline".
public void setShowSubClauseButton(java.lang.Boolean showSubClauseButton)
throws java.lang.IllegalStateException
TopOperatorAppearance is "radio" or "inline", true in all other cases.
showSubClauseButton - showSubClauseButton Default value is See Description
java.lang.IllegalStateException - this property cannot be changed after the component has been createdpublic java.lang.Boolean getShowSubClauseButton()
TopOperatorAppearance is "radio" or "inline", true in all other cases.
public void setSortFields(java.lang.Boolean sortFields)
throws java.lang.IllegalStateException
fieldPicker items be sorted
alphabetically in the drop down list.
sortFields - sortFields Default value is true
java.lang.IllegalStateException - this property cannot be changed after the component has been createdpublic java.lang.Boolean getSortFields()
fieldPicker items be sorted
alphabetically in the drop down list.
public void setSubClauseButtonPrompt(java.lang.String subClauseButtonPrompt)
throws java.lang.IllegalStateException
subClauseButtonPrompt - . See String. Default value is "Add Subclause"
java.lang.IllegalStateException - this property cannot be changed after the component has been createdpublic java.lang.String getSubClauseButtonPrompt()
String
public void setSubClauseButtonTitle(java.lang.String subClauseButtonTitle)
throws java.lang.IllegalStateException
subClauseButtonTitle - . See String. Default value is "+()"
java.lang.IllegalStateException - this property cannot be changed after the component has been createdpublic java.lang.String getSubClauseButtonTitle()
Stringpublic void setTopOperator(LogicalOperator topOperator)
May be able to be changed by the user via
the UI, according to TopOperatorAppearance.
If this method is called after the component has been drawn/initialized:
Programmatically change the topOperator for this FilterBuilder.
topOperator - new top-level operator. Default value is "and"public LogicalOperator getTopOperator()
May be able to be changed by the user via
the UI, according to TopOperatorAppearance.
public void setTopOperatorTitle(java.lang.String topOperatorTitle)
throws java.lang.IllegalStateException
topOperatorForm.
topOperatorTitle - . See String. Default value is "Clause Operator"
java.lang.IllegalStateException - this property cannot be changed after the component has been createdpublic java.lang.String getTopOperatorTitle()
topOperatorForm.
String
public void setValidateOnChange(java.lang.Boolean validateOnChange)
throws java.lang.IllegalStateException
FilterBuilder by calling FilterBuilder.validate from your own code.
validateOnChange - validateOnChange Default value is true
java.lang.IllegalStateException - this property cannot be changed after the component has been createdpublic java.lang.Boolean getValidateOnChange()
FilterBuilder by calling FilterBuilder.validate from your own code.
public void addClause(FilterClause filterClause)
FilterClause to this FilterBuilder. This API is intended for the
rare use case of adding a highly customized FilterClause component that does not include the standard
field/operator/value picking interface, instead providing a custom interface and returning a criterion via FilterClause.getCriterion.
If you just want to
programmatically add a new FilterClause showing a specific Criterion use FilterBuilder.addCriterion.
If you want to use the
standard field/operator/value interface but provide a custom control for editing the value, see DataSource.addSearchOperator and editorType.
filterClause - A FilterClause instancepublic void addCriterion(Criterion criterion)
criterion - new criterion to be addedpublic void clearCriteria()
public com.google.gwt.event.shared.HandlerRegistration addFilterChangedHandler(FilterChangedHandler handler)
Handler fired when there is a change() event fired on any FormItem within the filterBuilder.
addFilterChangedHandler in interface HasFilterChangedHandlershandler - the filterChanged handler
HandlerRegistration used to remove this handler
public java.lang.String getEditorType(DataSourceField field,
OperatorId operatorId)
Default behavior is to use the editorType for a custom operator,
otherwise, use RelativeDateItem for before/after/between operators on
date fields, otherwise, use the same editor as would be chosen by a SearchForm.
field - DataSourceField definitionoperatorId - OperatorId for the chosen operator
public com.google.gwt.event.shared.HandlerRegistration addSearchHandler(SearchHandler handler)
A StringMethod that is automatically invoked if saveOnEnter is set and the user presses Enter whilst in a text-item in any clause or subclause.
addSearchHandler in interface HasSearchHandlershandler - the search handler
HandlerRegistration used to remove this handlerpublic java.lang.Boolean validate()
public static void setDefaultProperties(FilterBuilder filterBuilderProperties)
Note: This method is intended for setting default attributes only and will effect all instances of the underlying class (including those automatically generated in JavaScript). This method should not be used to apply standard EventHandlers or override methods for a class - use a custom subclass instead.
filterBuilderProperties - properties that should be used as new defaults when instances of this class are createdpublic void onInit()
onInit in class Layoutprotected void onInit_FilterBuilder()
public void setShowFieldTitles(boolean showFieldTitles)
throws java.lang.IllegalStateException
showFieldTitles - showFieldTitles default is true
java.lang.IllegalStateException - this property cannot be changed after the component has been createdpublic void setDataSource(DataSource dataSource)
dataSource - dataSource Default value is nullpublic DataSource getDataSource()
DSRequest. Can be specified as either a DataSource instance or the String ID of a DataSource.
public void setTopOperatorAppearance(TopOperatorAppearance topOperatorAppearance)
throws java.lang.IllegalStateException
topOperator for
this FilterBuilder. See TopOperatorAppearance for a list of options.
topOperatorAppearance - topOperatorAppearance Default value is "bracket"
java.lang.IllegalStateException - this property cannot be changed after the component has been createdpublic void setCriteria(AdvancedCriteria criteria)
When initialized with criteria, appropriate clauses for editing the provided criteria will be automatically generated.
Note that empty or partial criteria are allowed, for example, criteria that
specify fieldName only will generate an expression with the
operator not chosen yet, and a ${isc.DocUtils.linkForRef('object:Criterion')} with a logical operator ("and" or
"or") but not ${isc.DocUtils.linkForRef('criteria.criteria','subcriteria')} defined will generate an empty
subclause. Set new criteria for editing.
An interface for editing the provided criteria will be generated
identically to what happens when initialized with Criteria.
Any existing criteria entered by the user will be discarded.
criteria - new criteria. Pass null or {} to effectively reset the
filterBuilder to it's initial state when no criteria are
specified. Default value is nullpublic AdvancedCriteria getCriteria()
public AdvancedCriteria getCriteria(boolean includeEmptyValues)
By - default if a user has selected a field and operator type, but has failed to enter a value for
the field it will be skipped. This optional parameter allows you to retrieve all criteria,
including those with an empty value attribute.
public FilterClause[] getSelectedClauses()
showSelectionCheckbox property is set. This
method is only applicable where TopOperatorAppearance is "inline" (because that is the only appearance that supports
showSelectionCheckbox)
protected static FilterClause[] convertToFilterClauseArray(com.google.gwt.core.client.JavaScriptObject nativeArray)
public void removeClause(FilterClause clause)
clause - clause as retrieved from filterBuilder.clausespublic Canvas[] getMembers()
Layout
getMembers in class Layout
public FormItem getValueFieldProperties(FieldType type,
java.lang.String fieldName,
OperatorId operatorId,
ValueItemType itemType,
java.lang.String fieldType)
Note that the valueType impacts when this method is called. For operators with valueType
"fieldType" or "custom", a single value field is displayed. For operators with valueType
"valueRange" two value-field items are displayed (one for the start and one for the end position). The
valueItemType parameter may be used to determine which form item is being generated.
type - type of the DataSource field for this filter row. Note that for DataSourceSimpleTypeField SimpleType
based DataSource fields this attribute will be nullfieldName - name of the DataSource field for this filter rowoperatorId - OperatorId for the chosen operatoritemType - What valueItem is being generated.fieldType - type of the DataSource field for this filter row. Typically one would use the parameter but this value is useful when the
FieldType is a custom SimpleType in which case the type will be FieldType.CUSTOM and this parameter is the name of the SimpleType
public com.smartgwt.logicalstructure.core.LogicalStructureObject setLogicalStructure(com.smartgwt.logicalstructure.widgets.form.FilterBuilderLogicalStructure s)
public com.smartgwt.logicalstructure.core.LogicalStructureObject getLogicalStructure()
getLogicalStructure in interface LogicalStructuregetLogicalStructure in class Layout
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||