|
|||||||||
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
${isc.DocUtils.linkForRef('object: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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
---|
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled |
Field Summary |
---|
Fields inherited from class com.smartgwt.client.widgets.BaseWidget |
---|
config, configOnly, id, isElementSet, scClassName |
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
FilterBuilder()
|
|
FilterBuilder(JavaScriptObject jsObj)
|
Method Summary | |
---|---|
HandlerRegistration |
addFilterChangedHandler(FilterChangedHandler handler)
Add a filterChanged handler. |
HandlerRegistration |
addSearchHandler(SearchHandler handler)
Add a search handler. |
void |
clearCriteria()
Clear all current criteria. |
protected JavaScriptObject |
create()
|
String |
getAddButtonPrompt()
The hover prompt text for the add button. |
Boolean |
getAllowEmpty()
If set to false, the last clause cannot be removed. |
AdvancedCriteria |
getCriteria()
Initial criteria. |
DataSource |
getDataSource()
The DataSource that this component should bind to for default fields and for performing DSRequest . |
static FilterBuilder |
getOrCreateRef(JavaScriptObject jsObj)
|
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. |
String |
getRemoveButtonPrompt()
The hover prompt text for the remove button. |
Boolean |
getSaveOnEnter()
If true, when the user hits the Enter key while focussed in a text-item in this FilterBuilder, we automatically invoke the user-supplied addSearchHandler(com.smartgwt.client.widgets.form.events.SearchHandler) method. |
Boolean |
getShowAddButton()
If set, a button will be shown underneath all current clauses allowing a new clause to be added. |
Boolean |
getShowFieldTitles()
If true (the default), show field titles in the drop-down box used to select a field for querying. |
Boolean |
getShowRemoveButton()
If set, a button will be shown for each clause allowing it to be removed. |
Boolean |
getShowSubClauseButton()
Whether to show a button that allows the user to add subclauses. |
String |
getSubClauseButtonPrompt()
The hover prompt text for the subClauseButton. |
String |
getSubClauseButtonTitle()
The hover title text of the subClauseButton |
LogicalOperator |
getTopOperator()
Default logical operator for all top-level clauses in the FilterBuilder. |
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). |
void |
setAddButtonPrompt(String addButtonPrompt)
The hover prompt text for the add button. |
void |
setAllowEmpty(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. |
void |
setRangeSeparator(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(String removeButtonPrompt)
The hover prompt text for the remove button. |
void |
setSaveOnEnter(Boolean saveOnEnter)
If true, when the user hits the Enter key while focussed in a text-item in this FilterBuilder, we automatically invoke the user-supplied addSearchHandler(com.smartgwt.client.widgets.form.events.SearchHandler) method. |
void |
setShowAddButton(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(Boolean showFieldTitles)
If true (the default), show field titles in the drop-down box used to select a field for querying. |
void |
setShowRemoveButton(Boolean showRemoveButton)
If set, a button will be shown for each clause allowing it to be removed. |
void |
setShowSubClauseButton(Boolean showSubClauseButton)
Whether to show a button that allows the user to add subclauses. |
void |
setSubClauseButtonPrompt(String subClauseButtonPrompt)
The hover prompt text for the subClauseButton. |
void |
setSubClauseButtonTitle(String subClauseButtonTitle)
The hover title text 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 |
setValidateOnChange(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). |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
addDomHandler, addHandler, delegateEvent, doAttachChildren, doDetachChildren, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, 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, setElement, setPixelSize, setSize, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, 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(JavaScriptObject jsObj)
Method Detail |
---|
public static FilterBuilder getOrCreateRef(JavaScriptObject jsObj)
protected JavaScriptObject create()
create
in class Layout
public void setSaveOnEnter(Boolean saveOnEnter) throws IllegalStateException
addSearchHandler(com.smartgwt.client.widgets.form.events.SearchHandler)
method.
saveOnEnter
- saveOnEnter Default value is null
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getSaveOnEnter()
addSearchHandler(com.smartgwt.client.widgets.form.events.SearchHandler)
method.
public void setShowFieldTitles(Boolean showFieldTitles) throws IllegalStateException
showFieldTitles
- showFieldTitles Default value is true
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getShowFieldTitles()
public void setValidateOnChange(Boolean validateOnChange) throws IllegalStateException
FilterBuilder
by calling ${isc.DocUtils.linkForRef('filterBuilder.validate')}
from your own code.
validateOnChange
- validateOnChange Default value is true
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getValidateOnChange()
FilterBuilder
by calling ${isc.DocUtils.linkForRef('filterBuilder.validate')}
from your own code.
public void setShowRemoveButton(Boolean showRemoveButton) throws IllegalStateException
showRemoveButton
- showRemoveButton Default value is true
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getShowRemoveButton()
public void setRemoveButtonPrompt(String removeButtonPrompt) throws IllegalStateException
removeButtonPrompt
- removeButtonPrompt Default value is "Remove"
IllegalStateException
- this property cannot be changed after the component has been createdpublic String getRemoveButtonPrompt()
public void setShowAddButton(Boolean showAddButton) throws IllegalStateException
showAddButton
- showAddButton Default value is true
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getShowAddButton()
public void setAddButtonPrompt(String addButtonPrompt) throws IllegalStateException
addButtonPrompt
- addButtonPrompt Default value is "Add"
IllegalStateException
- this property cannot be changed after the component has been createdpublic String getAddButtonPrompt()
public void setAllowEmpty(Boolean allowEmpty) throws IllegalStateException
allowEmpty
- allowEmpty Default value is false
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getAllowEmpty()
public void setTopOperator(LogicalOperator topOperator)
May be able to be changed by the user via
the UI, according to com.smartgwt.client..TopOperatorAppearance
.
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 com.smartgwt.client..TopOperatorAppearance
.
public void setRangeSeparator(String rangeSeparator) throws IllegalStateException
rangeSeparator
- rangeSeparator Default value is "and"
IllegalStateException
- this property cannot be changed after the component has been createdpublic String getRangeSeparator()
public void setShowSubClauseButton(Boolean showSubClauseButton) throws IllegalStateException
com.smartgwt.client..TopOperatorAppearance
is "radio", true in all other cases.
showSubClauseButton
- showSubClauseButton Default value is See Description
IllegalStateException
- this property cannot be changed after the component has been createdpublic Boolean getShowSubClauseButton()
com.smartgwt.client..TopOperatorAppearance
is "radio", true in all other cases.
public void setSubClauseButtonTitle(String subClauseButtonTitle) throws IllegalStateException
subClauseButtonTitle
- subClauseButtonTitle Default value is "+()"
IllegalStateException
- this property cannot be changed after the component has been createdpublic String getSubClauseButtonTitle()
public void setSubClauseButtonPrompt(String subClauseButtonPrompt) throws IllegalStateException
subClauseButtonPrompt
- subClauseButtonPrompt Default value is "Add Subclause"
IllegalStateException
- this property cannot be changed after the component has been createdpublic String getSubClauseButtonPrompt()
public void clearCriteria()
public 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 HasSearchHandlers
handler
- the search handler
HandlerRegistration
used to remove this handlerpublic HandlerRegistration addFilterChangedHandler(FilterChangedHandler handler)
Handler fired when there is a change() event fired on any FormItem within the filterBuilder.
addFilterChangedHandler
in interface HasFilterChangedHandlers
handler
- the filterChanged handler
HandlerRegistration
used to remove this handlerpublic void setShowFieldTitles(boolean showFieldTitles) throws IllegalStateException
showFieldTitles
- showFieldTitles default is true
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 IllegalStateException
topOperator
for
this FilterBuilder. See TopOperatorAppearance
for a list of options.
topOperatorAppearance
- topOperatorAppearance Default value is "bracket"
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()
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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |