com.smartgwt.client.widgets.form
Class FilterBuilder

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.smartgwt.client.widgets.BaseWidget
              extended by com.smartgwt.client.widgets.Canvas
                  extended by com.smartgwt.client.widgets.layout.Layout
                      extended by com.smartgwt.client.widgets.form.FilterBuilder
All Implemented Interfaces:
HasAttachHandlers, HasHandlers, EventListener, HasVisibility, IsWidget, LogicalStructure, HasClickHandlers, HasDoubleClickHandlers, HasDragMoveHandlers, HasDragRepositionMoveHandlers, HasDragRepositionStartHandlers, HasDragRepositionStopHandlers, HasDragResizeMoveHandlers, HasDragResizeStartHandlers, HasDragResizeStopHandlers, HasDragStartHandlers, HasDragStopHandlers, HasDropHandlers, HasDropMoveHandlers, HasDropOutHandlers, HasDropOverHandlers, HasFocusChangedHandlers, HasHoverHandlers, HasHoverHiddenHandlers, HasKeyDownHandlers, HasKeyPressHandlers, HasMouseDownHandlers, HasMouseMoveHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseStillDownHandlers, HasMouseUpHandlers, HasMouseWheelHandlers, HasMovedHandlers, HasParentMovedHandlers, HasResizedHandlers, HasRightMouseDownHandlers, HasScrolledHandlers, HasShowContextMenuHandlers, HasVisibilityChangedHandlers, HasFilterChangedHandlers, HasSearchHandlers, HasMembersChangedHandlers

public class FilterBuilder
extends Layout
implements HasFilterChangedHandlers, HasSearchHandlers

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
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
 
Field Summary
 
Fields inherited from class com.smartgwt.client.widgets.BaseWidget
config, configOnly, id, nativeObject, scClassName
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
FilterBuilder()
           
FilterBuilder(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.
 HandlerRegistration addFilterChangedHandler(FilterChangedHandler handler)
          Add a filterChanged handler.
 HandlerRegistration addSearchHandler(SearchHandler handler)
          Add a search handler.
static void changeAutoChildDefaults(String autoChildName, Canvas defaults)
          Changes the defaults for Canvas AutoChildren named autoChildName.
static void changeAutoChildDefaults(String autoChildName, FormItem defaults)
          Changes the defaults for FormItem AutoChildren named autoChildName.
 void clearCriteria()
          Clear all current criteria.
protected  JavaScriptObject create()
           
 ImgButton getAddButton()
          An ImgButton that allows new clauses to be added if showAddButton is set.
 String getAddButtonPrompt()
          The hover prompt text for the add button.
 Boolean getAllowEmpty()
          If set to false, the last clause cannot be removed.
 Canvas getBracket()
          Note : This API is non-functional (always returns null) and exists only to make you aware that this MultiAutoChild exists.
 VStack getClauseStack()
          VStack of all clauses that are part of this FilterBuilder
 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.
 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.
 String getFieldPickerTitle()
          The title for the field-picker select-item.
 Integer getFieldPickerWidth()
          Width for the field picker formItem displayed in clauses within this FilterBuilder.
 String getFieldPickerWidthAsString()
          Width for the field picker formItem displayed in clauses within this FilterBuilder.
 String getInlineAndNotTitle()
          Title for the "And Not" operator (only applicable to the "inline" appearance)
 String getInlineAndTitle()
          Title for the "And" operator (only applicable to the "inline" appearance)
 String getInlineOrTitle()
          Title for the "Or" operator (only applicable to the "inline" appearance)
 com.smartgwt.logicalstructure.core.LogicalStructureObject getLogicalStructure()
           
 String getMatchAllTitle()
          Title for the "Match All" (and) operator when using topOperatorAppearance:"radio".
 String getMatchAnyTitle()
          Title for the "Match Any" (or) operator when using topOperatorAppearance:"radio".
 String getMatchNoneTitle()
          Title for the "Match None" (not) operator when using topOperatorAppearance:"radio".
 Canvas[] getMembers()
          An array of canvases that will be contained within this layout.
 String getMissingFieldPrompt()
          The message to display next to fieldNames that do not exist in the available dataSource.
 Label getModeSwitcher()
          Label to change between simple and advanced mode.
 String getModeSwitcherAdvancedMessage()
          Title for the "Advanced.." mode switcher label (only applicable to the "radio" appearance).
 String getModeSwitcherFlattenWarningMessage()
          Message displayed when switching to "radio" mode if the criteria will be logically changed.
 String getModeSwitcherSimpleMessage()
          Title for the "Simple Mode.." mode switcher label (only applicable to the "bracket" appearance).
 SelectItem getOperatorPicker()
          Note : This API is non-functional (always returns null) and exists only to make you aware that this MultiAutoChild exists.
 FormItem getOperatorPickerProperties()
          Properties to combine with the operatorPicker autoChild FormItem.
 String getOperatorPickerTitle()
          The title for the operator-picker select-item.
 Integer getOperatorPickerWidth()
          Width for the operator picker formItem displayed in clauses within this FilterBuilder.
 String getOperatorPickerWidthAsString()
          Width for the operator picker formItem displayed in clauses within this FilterBuilder.
static FilterBuilder getOrCreateRef(JavaScriptObject jsObj)
           
 DynamicForm getRadioOperatorForm()
          With TopOperatorAppearance:"radio", form that appears above the stack of clauses and allows picking the LogicalOperator for the overall FilterBuilder.
 HLayout getRadioOperatorLayout()
          HLayout of radioOperationForm and optional modeSwitcher.
 String getRadioOperatorTitle()
          The title for the Operator RadioGroupItem displayed in the radioOperatorForm.
 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.
 ImgButton getRemoveButton()
          The removal ImgButton that appears before each clause if showRemoveButton is set.
 String getRemoveButtonPrompt()
          The hover prompt text for the remove button.
 Boolean getRetainValuesAcrossFields()
          Dictates whether values entered by a user should be retained in the value fields when a different field is selected.
 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.
 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 getShowModeSwitcher()
          When enabled allows FilterBuilder in topOperatorAppearance:"radio" or topOperatorAppearance:"bracket" mode to be switch to the other view by the user.
 Boolean getShowRemoveButton()
          If set, a button will be shown for each clause allowing it to be removed.
 Boolean getShowSelectionCheckbox()
          If true, causes a CheckboxItem to appear to the left of each clause in "inline" appearance.
 Boolean getShowSubClauseButton()
          Whether to show a button that allows the user to add subclauses.
 Boolean getSortFields()
          Should the FieldPicker items be sorted alphabetically in the drop down list.
 IButton getSubClauseButton()
          Button allowing the user to add subclauses grouped by a LogicalOperator.
 String getSubClauseButtonPrompt()
          The hover prompt text for the subClauseButton.
 String getSubClauseButtonTitle()
          The title of the subClauseButton
 LogicalOperator getTopOperator()
          Default logical operator for all top-level clauses in the FilterBuilder.
 DynamicForm getTopOperatorForm()
          With TopOperatorAppearance "bracket" and "inline", a form that appears to the left of the stack of clauses and allows picking the LogicalOperator for the overall FilterBuilder (or for that specific FilterClause, in the case of "inline")
 SelectItem getTopOperatorItem()
          Automatically generated SelectItem autoChild shown in the topOperatorForm.
 int getTopOperatorItemWidth()
          Width for the topOperatorItem autoChild.
 String getTopOperatorItemWidthAsString()
          Width for the topOperatorItem autoChild.
 OperatorId[] getTopOperatorOptions()
          Logical operators to allow for TopOperatorAppearances of "radio" and "bracket".
 String getTopOperatorTitle()
          The title for the left-aligned Operator selectItem in the topOperatorForm.
 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, String fieldName, OperatorId operatorId, ValueItemType itemType, String fieldType)
          Override to return properties for the FormItem(s) used for the "value" field displayed within clauses within this filterBuilder.
 Integer getValueItemWidth()
          Width for the value-chooser formItem displayed in clauses within this FilterBuilder.
 String getValueItemWidthAsString()
          Width for the value-chooser formItem displayed in clauses within this FilterBuilder.
protected  void onInit_FilterBuilder()
           
 void onInit()
           
 void removeClause(FilterClause clause)
          Remove a clause this FilterBuilder is currently showing.
 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.
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(String fieldPickerTitle)
          The title for the field-picker select-item.
 void setFieldPickerWidth(Integer fieldPickerWidth)
          Width for the field picker formItem displayed in clauses within this FilterBuilder.
 void setFieldPickerWidth(String fieldPickerWidth)
          Width for the field picker formItem displayed in clauses within this FilterBuilder.
 void setInlineAndNotTitle(String inlineAndNotTitle)
          Title for the "And Not" operator (only applicable to the "inline" appearance)
 void setInlineAndTitle(String inlineAndTitle)
          Title for the "And" operator (only applicable to the "inline" appearance)
 void setInlineOrTitle(String inlineOrTitle)
          Title for the "Or" operator (only applicable to the "inline" appearance)
 com.smartgwt.logicalstructure.core.LogicalStructureObject setLogicalStructure(com.smartgwt.logicalstructure.widgets.form.FilterBuilderLogicalStructure s)
           
 void setMatchAllTitle(String matchAllTitle)
          Title for the "Match All" (and) operator when using topOperatorAppearance:"radio".
 void setMatchAnyTitle(String matchAnyTitle)
          Title for the "Match Any" (or) operator when using topOperatorAppearance:"radio".
 void setMatchNoneTitle(String matchNoneTitle)
          Title for the "Match None" (not) operator when using topOperatorAppearance:"radio".
 void setMissingFieldPrompt(String missingFieldPrompt)
          The message to display next to fieldNames that do not exist in the available dataSource.
 void setModeSwitcherAdvancedMessage(String modeSwitcherAdvancedMessage)
          Title for the "Advanced.." mode switcher label (only applicable to the "radio" appearance).
 void setModeSwitcherFlattenWarningMessage(String modeSwitcherFlattenWarningMessage)
          Message displayed when switching to "radio" mode if the criteria will be logically changed.
 void setModeSwitcherSimpleMessage(String modeSwitcherSimpleMessage)
          Title for the "Simple Mode.." mode switcher label (only applicable to the "bracket" appearance).
 void setOperatorPickerProperties(FormItem operatorPickerProperties)
          Properties to combine with the operatorPicker autoChild FormItem.
 void setOperatorPickerTitle(String operatorPickerTitle)
          The title for the operator-picker select-item.
 void setOperatorPickerWidth(Integer operatorPickerWidth)
          Width for the operator picker formItem displayed in clauses within this FilterBuilder.
 void setOperatorPickerWidth(String operatorPickerWidth)
          Width for the operator picker formItem displayed in clauses within this FilterBuilder.
 void setRadioOperatorTitle(String radioOperatorTitle)
          The title for the Operator RadioGroupItem displayed in the radioOperatorForm.
 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 setRetainValuesAcrossFields(Boolean retainValuesAcrossFields)
          Dictates whether values entered by a user should be retained in the value fields when a different field is selected.
 void setSaveOnEnter(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(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 setShowModeSwitcher(Boolean showModeSwitcher)
          When enabled allows FilterBuilder in topOperatorAppearance:"radio" or topOperatorAppearance:"bracket" mode to be switch to the other view by the user.
 void setShowRemoveButton(Boolean showRemoveButton)
          If set, a button will be shown for each clause allowing it to be removed.
 void setShowSelectionCheckbox(Boolean showSelectionCheckbox)
          If true, causes a CheckboxItem to appear to the left of each clause in "inline" appearance.
 void setShowSubClauseButton(Boolean showSubClauseButton)
          Whether to show a button that allows the user to add subclauses.
 void setSortFields(Boolean sortFields)
          Should the FieldPicker items be sorted alphabetically in the drop down list.
 void setSubClauseButtonPrompt(String subClauseButtonPrompt)
          The hover prompt text for the subClauseButton.
 void setSubClauseButtonTitle(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 setTopOperatorItemWidth(int topOperatorItemWidth)
          Width for the topOperatorItem autoChild.
 void setTopOperatorItemWidth(String topOperatorItemWidth)
          Width for the topOperatorItem autoChild.
 void setTopOperatorOptions(OperatorId... topOperatorOptions)
          Logical operators to allow for TopOperatorAppearances of "radio" and "bracket".
 void setTopOperatorTitle(String topOperatorTitle)
          The title for the left-aligned Operator selectItem in the topOperatorForm.
 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).
 void setValueItemWidth(Integer valueItemWidth)
          Width for the value-chooser formItem displayed in clauses within this FilterBuilder.
 void setValueItemWidth(String valueItemWidth)
          Width for the value-chooser formItem displayed in clauses within this FilterBuilder.
 Boolean validate()
          Validate the clauses of this FilterBuilder.
 
Methods inherited from class com.smartgwt.client.widgets.layout.Layout
addMember, addMember, addMember, addMember, addMemberPostCreate, addMemberPostCreate, addMemberPreCreate, addMemberPreCreate, addMembers, addMembers, addMembersChangedHandler, getAnimateMembers, getAnimateMemberTime, getCanDropComponents, getDefaultResizeBars, getDropComponent, getDropLine, getDropLineThickness, getDropPosition, getEnforcePolicy, getHPolicy, getLayoutBottomMargin, getLayoutLeftMargin, getLayoutMargin, getLayoutRightMargin, getLayoutTopMargin, getLeaveScrollbarGap, getLocateMembersBy, getLocateMembersType, getManagePercentBreadth, getMember, getMember, getMemberDefaultBreadth, getMemberNumber, getMemberNumber, getMemberOverlap, getMembersMargin, getMinMemberSize, getOverflow, getPaddingAsLayoutMargin, getResizeBarClass, getResizeBarSize, getReverseOrder, getShowDragPlaceHolder, getShowDropLines, getStackZIndex, getVertical, getVPolicy, hasMember, hideDropLine, hideMember, hideMember, onInit_Layout, reflow, reflow, reflowNow, removeMember, removeMembers, removeMembers, reorderMember, reorderMembers, setAlign, setAlign, setAnimateMembers, setAnimateMemberTime, setCanDropComponents, setDefaultLayoutAlign, setDefaultLayoutAlign, setDefaultProperties, setDefaultResizeBars, setDropLineProperties, setDropLineThickness, setEnforcePolicy, setHPolicy, setLayoutBottomMargin, setLayoutLeftMargin, setLayoutMargin, setLayoutRightMargin, setLayoutTopMargin, setLeaveScrollbarGap, setLocateMembersBy, setLocateMembersType, setLogicalStructure, setManagePercentBreadth, setMemberOverlap, setMembers, setMembersMargin, setMinMemberSize, setOverflow, setPaddingAsLayoutMargin, setPlaceHolderDefaults, setPlaceHolderProperties, setResizeBarClass, setResizeBarSize, setReverseOrder, setShowDragPlaceHolder, setShowDropLines, setStackZIndex, setVertical, setVisibleMember, setVPolicy, showMember, showMember
 
Methods inherited from class com.smartgwt.client.widgets.Canvas
addChild, addChild, addChild, addChild, addChild, addClickHandler, addDoubleClickHandler, addDragMoveHandler, addDragRepositionMoveHandler, addDragRepositionStartHandler, addDragRepositionStopHandler, addDragResizeMoveHandler, addDragResizeStartHandler, addDragResizeStopHandler, addDragStartHandler, addDragStopHandler, addDropHandler, addDropMoveHandler, addDropOutHandler, addDropOverHandler, addFocusChangedHandler, addHoverHandler, addHoverHiddenHandler, addKeyDownHandler, addKeyPressHandler, addMouseDownHandler, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseStillDownHandler, addMouseUpHandler, addMouseWheelHandler, addMovedHandler, addParentMovedHandler, addPeer, addPeer, addPeer, addPeer, addResizedHandler, addRightMouseDownHandler, addScrolledHandler, addShowContextMenuHandler, addStyleName, addVisibilityChangedHandler, adjustForContent, animateFade, animateFade, animateFade, animateFade, animateFade, animateFade, animateFade, animateFade, animateHide, animateHide, animateHide, animateMove, animateMove, animateMove, animateMove, animateRect, animateRect, animateRect, animateRect, animateResize, animateResize, animateResize, animateResize, animateScroll, animateScroll, animateScroll, animateScroll, animateScroll, animateScroll, animateShow, animateShow, animateShow, animateShow, animateShow, animateShow, asSGWTComponent, blur, bringToFront, clear, clickMaskUp, clickMaskUp, contains, contains, containsEvent, containsFocus, containsPoint, containsPoint, deparent, depeer, disable, enable, focus, focusInNextTabElement, focusInPreviousTabElement, getAbsoluteLeft, getAbsoluteTop, getAccessKey, getAnimateAcceleration, getAnimateFadeTime, getAnimateHideAcceleration, getAnimateHideTime, getAnimateMoveAcceleration, getAnimateMoveTime, getAnimateRectAcceleration, getAnimateRectTime, getAnimateResizeAcceleration, getAnimateResizeTime, getAnimateScrollAcceleration, getAnimateScrollTime, getAnimateShowAcceleration, getAnimateShowEffect, getAnimateShowTime, getAnimateTime, getAppImgDir, getAriaRole, getAutoDraw, getAutoShowParent, getBackgroundColor, getBackgroundImage, getBackgroundPosition, getBackgroundRepeat, getBorder, getBottom, getById, getByJSObject, getByLocalId, getCanAcceptDrop, getCanDrag, getCanDragReposition, getCanDragResize, getCanDragScroll, getCanDrop, getCanDropBefore, getCanFocus, getCanHover, getCanSelectText, getCanvasAutoChild, getCanvasItem, getChildren, getChildrenSnapResizeToGrid, getChildrenSnapToGrid, getClassName, getContentElement, getContents, getContextMenu, getCursor, getDataPath, getDefaultHeight, getDefaultWidth, getDestroyed, getDestroying, getDisabled, getDisabledCursor, getDoubleClickDelay, getDragAppearance, getDragIntersectStyle, getDragMaskType, getDragOpacity, getDragRepositionAppearance, getDragRepositionCursor, getDragResizeAppearance, getDragScrollDelay, getDragStartDistance, getDragTarget, getDragType, getDropTypes, getDropTypesAsString, getDynamicContents, getEdgeBackgroundColor, getEdgeCenterBackgroundColor, getEdgeImage, getEdgeMarginSize, getEdgeOffset, getEdgeOpacity, getEdgeShowCenter, getEdgeSize, getElement, getElement, getEventEdge, getEventEdge, getExtraSpace, getFacetId, getFormItemAutoChild, getFullDataPath, getGroupBorderCSS, getGroupLabelBackgroundColor, getGroupLabelStyleName, getGroupTitle, getHeight, getHeightAsString, getHideUsingDisplayNone, getHoverAlign, getHoverAutoDestroy, getHoverComponent, getHoverDelay, getHoverHeight, getHoverHTML, getHoverMoveWithMouse, getHoverOpacity, getHoverStyle, getHoverVAlign, getHoverWidth, getHoverWrap, getHSnapOrigin, getHSnapOrigin, getHSnapPosition, getHSnapPosition, getHtmlElement, getHtmlPosition, getImage, getImgURL, getImgURL, getInnerContentHeight, getInnerContentWidth, getInnerHeight, getInnerWidth, getIsGroup, getKeepInParentRect, getLayoutAlign, getLeft, getLeftAsString, getLocateChildrenBy, getLocateChildrenType, getLocatePeersBy, getLocatePeersType, getMargin, getMasterCanvas, getMasterElement, getMatchElement, getMaxHeight, getMaxWidth, getMenuConstructor, getMinHeight, getMinWidth, getMomentumScrollMinSpeed, getMouseStillDownDelay, getMouseStillDownInitialDelay, getNextZIndex, getNoDoubleClicks, getOffsetHeight, getOffsetWidth, getOffsetX, getOffsetY, getOpacity, getOuterElement, getPadding, getPageBottom, getPageLeft, getPageRect, getPageRight, getPageTop, getParentCanvas, getParentElement, getPeers, getPercentBox, getPercentSource, getPosition, getPrefix, getPrintChildrenAbsolutelyPositioned, getPrintHTML, getPrintHTML, getPrompt, getRect, getRedrawOnResize, getResizeBarTarget, getResizeFrom, getRight, getScrollbarSize, getScrollBottom, getScrollHeight, getScrollLeft, getScrollRight, getScrollTop, getScrollWidth, getShadowDepth, getShadowImage, getShadowOffset, getShadowSoftness, getShouldPrint, getShowCustomScrollbars, getShowDragShadow, getShowEdges, getShowHover, getShowHoverComponents, getShowResizeBar, getShowShadow, getShrinkElementOnHide, getSkinImgDir, getSnapAxis, getSnapEdge, getSnapHDirection, getSnapHGap, getSnapOffsetLeft, getSnapOffsetTop, getSnapOnDrop, getSnapResizeToGrid, getSnapTo, getSnapToGrid, getSnapVDirection, getSnapVGap, getStyleName, getTabIndex, getTestInstance, getTitle, getTooltip, getTop, getTopAsString, getTopElement, getUseBackMask, getUseDragMask, getUseNativeDrag, getUseOpacityFilter, getValuesManager, getViewportHeight, getViewportWidth, getVisibility, getVisibleHeight, getVisibleWidth, getVSnapOrigin, getVSnapOrigin, getVSnapPosition, getVSnapPosition, getWidth, getWidthAsString, getZIndex, getZIndex, handleHover, hide, hideClickMask, hideClickMask, hideContextMenu, imgHTML, imgHTML, imgHTML, intersects, isDirty, isDisabled, isDrawn, isVisible, keyUp, layoutChildren, linkHTML, linkHTML, linkHTML, linkHTML, linkHTML, linkHTML, markForDestroy, markForRedraw, markForRedraw, moveAbove, moveBelow, moveBy, moveTo, onAttach, onDetach, parentResized, printComponents, redraw, redraw, removeChild, removeChild, removePeer, removePeer, resizeBy, resizeTo, resizeTo, scrollBy, scrollByPercent, scrollTo, scrollTo, scrollTo, scrollToBottom, scrollToLeft, scrollToPercent, scrollToRight, scrollToTop, sendToBack, setAccessKey, setAllowExternalFilters, setAnimateAcceleration, setAnimateFadeTime, setAnimateHideAcceleration, setAnimateHideTime, setAnimateMoveAcceleration, setAnimateMoveTime, setAnimateRectAcceleration, setAnimateRectTime, setAnimateResizeAcceleration, setAnimateResizeTime, setAnimateScrollAcceleration, setAnimateScrollTime, setAnimateShowAcceleration, setAnimateShowEffect, setAnimateShowTime, setAnimateTime, setAppImgDir, setAriaRole, setAriaState, setAutoChildConstructor, setAutoChildProperties, setAutoChildProperties, setAutoChildVisibility, setAutoDraw, setAutoHeight, setAutoShowParent, setAutoWidth, setBackgroundColor, setBackgroundImage, setBackgroundPosition, setBackgroundRepeat, setBorder, setBottom, setCanAcceptDrop, setCanDrag, setCanDragReposition, setCanDragResize, setCanDragScroll, setCanDrop, setCanDropBefore, setCanFocus, setCanHover, setCanSelectText, setChildren, setChildrenSnapResizeToGrid, setChildrenSnapToGrid, setContents, setContextMenu, setCursor, setDataPath, setDefaultHeight, setDefaultProperties, setDefaultWidth, setDisabled, setDisabledCursor, setDoubleClickDelay, setDragAppearance, setDragIntersectStyle, setDragMaskType, setDragOpacity, setDragRepositionAppearance, setDragRepositionCursor, setDragResizeAppearance, setDragScrollDelay, setDragStartDistance, setDragTarget, setDragType, setDropTypes, setDropTypes, setDynamicContents, setEdgeBackgroundColor, setEdgeCenterBackgroundColor, setEdgeImage, setEdgeMarginSize, setEdgeOffset, setEdgeOpacity, setEdgeShowCenter, setEdgeSize, setElement, setExtraSpace, setFacetId, setGroupBorderCSS, setGroupLabelBackgroundColor, setGroupLabelStyleName, setGroupTitle, setHeight, setHeight, setHeight, setHeight100, setHideUsingDisplayNone, setHoverAlign, setHoverAutoDestroy, setHoverDelay, setHoverHeight, setHoverMoveWithMouse, setHoverOpacity, setHoverStyle, setHoverVAlign, setHoverWidth, setHoverWrap, setHtmlElement, setHtmlPosition, setImage, setImage, setInitHandler, setIsGroup, setKeepInParentRect, setKeepInParentRect, setKeepInParentRect, setLayoutAlign, setLayoutAlign, setLeft, setLeft, setLocateChildrenBy, setLocateChildrenType, setLocatePeersBy, setLocatePeersType, setLogicalStructure, setMargin, setMatchElement, setMaxHeight, setMaxWidth, setMenuConstructor, setMinHeight, setMinWidth, setMomentumScrollMinSpeed, setMouseStillDownDelay, setMouseStillDownInitialDelay, setNeverUseFilters, setNoDoubleClicks, setOpacity, setPadding, setPageLeft, setPageTop, setParentCanvas, setParentElement, setPeers, setPercentBox, setPercentSource, setPosition, setPrefix, setPrintChildrenAbsolutelyPositioned, setPrompt, setRect, setRect, setRedrawOnResize, setResizeBarTarget, setResizeFrom, setResizeFrom, setRight, setScrollbarConstructor, setScrollbarSize, setShadowDepth, setShadowImage, setShadowOffset, setShadowSoftness, setShouldPrint, setShowCustomScrollbars, setShowDragShadow, setShowEdges, setShowHover, setShowHoverComponents, setShowResizeBar, setShowShadow, setShrinkElementOnHide, setSkinImgDir, setSmoothFade, setSnapAxis, setSnapEdge, setSnapHDirection, setSnapHGap, setSnapOffsetLeft, setSnapOffsetTop, setSnapOnDrop, setSnapResizeToGrid, setSnapTo, setSnapToGrid, setSnapVDirection, setSnapVGap, setStyleName, setTabIndex, setTitle, setTooltip, setTop, setTop, setUseBackMask, setUseDragMask, setUseNativeDrag, setUseOpacityFilter, setValuesManager, setVisibility, setVisible, setWidth, setWidth, setWidth, setWidth100, setZIndex, shouldDragScroll, show, showClickMask, showNextTo, showNextTo, showNextTo, showNextTo, showPrintPreview, showPrintPreview, showPrintPreview, showPrintPreview, showRecursively, updateEditNode, updateHover, updateHover, updateShadow, visibleAtPoint, willAcceptDrop
 
Methods inherited from class com.smartgwt.client.widgets.BaseWidget
addDrawHandler, destroy, doAddHandler, doInit, doOnRender, draw, equals, error, errorIfNotCreated, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDateArray, getAttributeAsDouble, getAttributeAsElement, getAttributeAsFloat, getAttributeAsFloatArray, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsJavaScriptObject, getAttributeAsMap, getAttributeAsRecord, getAttributeAsString, getAttributeAsStringArray, getConfig, getDOM, getHandlerCount, getID, getInnerHTML, getJsObj, getOrCreateJsObj, getRef, getScClassName, hasAutoAssignedID, hashCode, initNativeObject, internalSetID, internalSetID, isConfigOnly, isCreated, onBind, onDestroy, onDraw, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setConfig, setConfigOnly, setDragTracker, setID, setJavaScriptObject, setLogicalStructure, setNullProperty, setPosition, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setScClassName, toString
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, 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

FilterBuilder

public FilterBuilder()

FilterBuilder

public FilterBuilder(JavaScriptObject jsObj)
Method Detail

getOrCreateRef

public static FilterBuilder getOrCreateRef(JavaScriptObject jsObj)

changeAutoChildDefaults

public static void changeAutoChildDefaults(String autoChildName,
                                           Canvas defaults)
Changes the defaults for Canvas AutoChildren named autoChildName.

Parameters:
autoChildName - name of an AutoChild to customize the defaults for.
defaults - Canvas defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties.
See Also:
AutoChildUsage

changeAutoChildDefaults

public static void changeAutoChildDefaults(String autoChildName,
                                           FormItem defaults)
Changes the defaults for FormItem AutoChildren named autoChildName.

Parameters:
autoChildName - name of an AutoChild to customize the defaults for.
defaults - FormItem defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties.
See Also:
AutoChildUsage

create

protected JavaScriptObject create()
Overrides:
create in class Layout

getAddButton

public ImgButton getAddButton()
                       throws IllegalStateException
An ImgButton that allows new clauses to be added if showAddButton is set.

For an overview of how to use and configure AutoChildren, see Using AutoChildren.

Returns:
ImgButton
Throws:
IllegalStateException - if this widget has not yet been rendered.

setAddButtonPrompt

public void setAddButtonPrompt(String addButtonPrompt)
                        throws IllegalStateException
The hover prompt text for the add button.

Parameters:
addButtonPrompt - Default value is "Add"
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getAddButtonPrompt

public String getAddButtonPrompt()
The hover prompt text for the add button.

Returns:
String

setAllowEmpty

public void setAllowEmpty(Boolean allowEmpty)
                   throws IllegalStateException
If set to false, the last clause cannot be removed.

Parameters:
allowEmpty - Default value is false
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getAllowEmpty

public Boolean getAllowEmpty()
If set to false, the last clause cannot be removed.

Returns:
Boolean

getBracket

public Canvas getBracket()
Note : This API is non-functional (always returns null) and exists only to make you aware that this MultiAutoChild exists. See Using AutoChildren for details.

Widget used as a "bracket" to hint to the user that a subclause groups several field-by-field filter criteria under one logical operator.

By default, a simple CSS-style Canvas with borders on three sides. A vertical StretchImg could provide a more elaborate appearance.

Returns:
null

getClauseStack

public VStack getClauseStack()
                      throws IllegalStateException
VStack of all clauses that are part of this FilterBuilder

For an overview of how to use and configure AutoChildren, see Using AutoChildren.

Returns:
VStack
Throws:
IllegalStateException - if this widget has not yet been rendered.

setFieldDataSource

public void setFieldDataSource(DataSource fieldDataSource)
                        throws IllegalStateException
If specified, the FilterBuilder will dynamically fetch DataSourceField definitions from this DataSource rather than using 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.

Parameters:
fieldDataSource - Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getFieldDataSource

public DataSource getFieldDataSource()
If specified, the FilterBuilder will dynamically fetch DataSourceField definitions from this DataSource rather than using 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.

Returns:
DataSource

setFieldPickerProperties

public void setFieldPickerProperties(FormItem fieldPickerProperties)
                              throws IllegalStateException
Properties to combine with the FieldPicker autoChild FormItem.

Parameters:
fieldPickerProperties - Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getFieldPickerProperties

public FormItem getFieldPickerProperties()
Properties to combine with the FieldPicker autoChild FormItem.

Returns:
FormItem

setFieldPickerTitle

public void setFieldPickerTitle(String fieldPickerTitle)
                         throws IllegalStateException
The title for the field-picker select-item.

Parameters:
fieldPickerTitle - Default value is "Field Name"
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getFieldPickerTitle

public String getFieldPickerTitle()
The title for the field-picker select-item.

Returns:
String

setFieldPickerWidth

public void setFieldPickerWidth(Integer fieldPickerWidth)
                         throws IllegalStateException
Width for the field picker formItem displayed in clauses within this FilterBuilder.

Parameters:
fieldPickerWidth - Default value is "*"
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getFieldPickerWidth

public Integer getFieldPickerWidth()
Width for the field picker formItem displayed in clauses within this FilterBuilder.

Returns:
Integer

setFieldPickerWidth

public void setFieldPickerWidth(String fieldPickerWidth)
                         throws IllegalStateException
Width for the field picker formItem displayed in clauses within this FilterBuilder.

Parameters:
fieldPickerWidth - Default value is "*"
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getFieldPickerWidthAsString

public String getFieldPickerWidthAsString()
Width for the field picker formItem displayed in clauses within this FilterBuilder.

Returns:
String

setInlineAndNotTitle

public void setInlineAndNotTitle(String inlineAndNotTitle)
                          throws IllegalStateException
Title for the "And Not" operator (only applicable to the "inline" appearance)

Parameters:
inlineAndNotTitle - Default value is "and not"
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getInlineAndNotTitle

public String getInlineAndNotTitle()
Title for the "And Not" operator (only applicable to the "inline" appearance)

Returns:
String

setInlineAndTitle

public void setInlineAndTitle(String inlineAndTitle)
                       throws IllegalStateException
Title for the "And" operator (only applicable to the "inline" appearance)

Parameters:
inlineAndTitle - Default value is "and"
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getInlineAndTitle

public String getInlineAndTitle()
Title for the "And" operator (only applicable to the "inline" appearance)

Returns:
String

setInlineOrTitle

public void setInlineOrTitle(String inlineOrTitle)
                      throws IllegalStateException
Title for the "Or" operator (only applicable to the "inline" appearance)

Parameters:
inlineOrTitle - Default value is "or"
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getInlineOrTitle

public String getInlineOrTitle()
Title for the "Or" operator (only applicable to the "inline" appearance)

Returns:
String

setMatchAllTitle

public void setMatchAllTitle(String matchAllTitle)
                      throws IllegalStateException
Title for the "Match All" (and) operator when using topOperatorAppearance:"radio".

Parameters:
matchAllTitle - Default value is "Match All"
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getMatchAllTitle

public String getMatchAllTitle()
Title for the "Match All" (and) operator when using topOperatorAppearance:"radio".

Returns:
String

setMatchAnyTitle

public void setMatchAnyTitle(String matchAnyTitle)
                      throws IllegalStateException
Title for the "Match Any" (or) operator when using topOperatorAppearance:"radio".

Parameters:
matchAnyTitle - Default value is "Match Any"
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getMatchAnyTitle

public String getMatchAnyTitle()
Title for the "Match Any" (or) operator when using topOperatorAppearance:"radio".

Returns:
String

setMatchNoneTitle

public void setMatchNoneTitle(String matchNoneTitle)
                       throws IllegalStateException
Title for the "Match None" (not) operator when using topOperatorAppearance:"radio".

Parameters:
matchNoneTitle - Default value is "Match None"
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getMatchNoneTitle

public String getMatchNoneTitle()
Title for the "Match None" (not) operator when using topOperatorAppearance:"radio".

Returns:
String

setMissingFieldPrompt

public void setMissingFieldPrompt(String missingFieldPrompt)
                           throws IllegalStateException
The message to display next to fieldNames that do not exist in the available dataSource.

Parameters:
missingFieldPrompt - Default value is "[missing field definition]"
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getMissingFieldPrompt

public String getMissingFieldPrompt()
The message to display next to fieldNames that do not exist in the available dataSource.

Returns:
String

getModeSwitcher

public Label getModeSwitcher()
                      throws IllegalStateException
Label to change between simple and advanced mode. When clicked the filter mode is switched to the other mode. This label is only shown if showModeSwitcher is true.

Shows either modeSwitcherSimpleMessage or modeSwitcherAdvancedMessage depending on the current state of the filter.

For an overview of how to use and configure AutoChildren, see Using AutoChildren.

Returns:
Label
Throws:
IllegalStateException - if this widget has not yet been rendered.

setModeSwitcherAdvancedMessage

public void setModeSwitcherAdvancedMessage(String modeSwitcherAdvancedMessage)
                                    throws IllegalStateException
Title for the "Advanced.." mode switcher label (only applicable to the "radio" appearance).

Parameters:
modeSwitcherAdvancedMessage - Default value is "Advanced.."
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getModeSwitcherAdvancedMessage

public String getModeSwitcherAdvancedMessage()
Title for the "Advanced.." mode switcher label (only applicable to the "radio" appearance).

Returns:
String

setModeSwitcherFlattenWarningMessage

public void setModeSwitcherFlattenWarningMessage(String modeSwitcherFlattenWarningMessage)
                                          throws IllegalStateException
Message displayed when switching to "radio" mode if the criteria will be logically changed.

Parameters:
modeSwitcherFlattenWarningMessage - Default value is "Criteria will be modified to fit in simpler editing interface"
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getModeSwitcherFlattenWarningMessage

public String getModeSwitcherFlattenWarningMessage()
Message displayed when switching to "radio" mode if the criteria will be logically changed.

Returns:
String

setModeSwitcherSimpleMessage

public void setModeSwitcherSimpleMessage(String modeSwitcherSimpleMessage)
                                  throws IllegalStateException
Title for the "Simple Mode.." mode switcher label (only applicable to the "bracket" appearance).

Parameters:
modeSwitcherSimpleMessage - Default value is "Simple Mode.."
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getModeSwitcherSimpleMessage

public String getModeSwitcherSimpleMessage()
Title for the "Simple Mode.." mode switcher label (only applicable to the "bracket" appearance).

Returns:
String

getOperatorPicker

public SelectItem getOperatorPicker()
Note : This API is non-functional (always returns null) and exists only to make you aware that this MultiAutoChild exists. See Using AutoChildren for details.

AutoChild for the FormItem that allows a user to select the operator when creating filter clauses. Each clause will create an operatorPicker automatically. To customize this item, use operatorPickerProperties

Returns:
null

setOperatorPickerProperties

public void setOperatorPickerProperties(FormItem operatorPickerProperties)
                                 throws IllegalStateException
Properties to combine with the operatorPicker autoChild FormItem.

Parameters:
operatorPickerProperties - Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getOperatorPickerProperties

public FormItem getOperatorPickerProperties()
Properties to combine with the operatorPicker autoChild FormItem.

Returns:
FormItem

setOperatorPickerTitle

public void setOperatorPickerTitle(String operatorPickerTitle)
                            throws IllegalStateException
The title for the operator-picker select-item.

Parameters:
operatorPickerTitle - Default value is "Operator"
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getOperatorPickerTitle

public String getOperatorPickerTitle()
The title for the operator-picker select-item.

Returns:
String

setOperatorPickerWidth

public void setOperatorPickerWidth(Integer operatorPickerWidth)
                            throws IllegalStateException
Width for the operator picker formItem displayed in clauses within this FilterBuilder.

Parameters:
operatorPickerWidth - Default value is 150
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getOperatorPickerWidth

public Integer getOperatorPickerWidth()
Width for the operator picker formItem displayed in clauses within this FilterBuilder.

Returns:
Integer

setOperatorPickerWidth

public void setOperatorPickerWidth(String operatorPickerWidth)
                            throws IllegalStateException
Width for the operator picker formItem displayed in clauses within this FilterBuilder.

Parameters:
operatorPickerWidth - Default value is 150
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getOperatorPickerWidthAsString

public String getOperatorPickerWidthAsString()
Width for the operator picker formItem displayed in clauses within this FilterBuilder.

Returns:
String

getRadioOperatorForm

public DynamicForm getRadioOperatorForm()
                                 throws IllegalStateException
With TopOperatorAppearance:"radio", form that appears above the stack of clauses and allows picking the LogicalOperator for the overall FilterBuilder.

By default, consists of a simple RadioGroupItem.

For an overview of how to use and configure AutoChildren, see Using AutoChildren.

Returns:
DynamicForm
Throws:
IllegalStateException - if this widget has not yet been rendered.

getRadioOperatorLayout

public HLayout getRadioOperatorLayout()
                               throws IllegalStateException
HLayout of radioOperationForm and optional modeSwitcher.

For an overview of how to use and configure AutoChildren, see Using AutoChildren.

Returns:
HLayout
Throws:
IllegalStateException - if this widget has not yet been rendered.

setRadioOperatorTitle

public void setRadioOperatorTitle(String radioOperatorTitle)
                           throws IllegalStateException
The title for the Operator RadioGroupItem displayed in the radioOperatorForm.

Parameters:
radioOperatorTitle - Default value is "Overall Operator"
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getRadioOperatorTitle

public String getRadioOperatorTitle()
The title for the Operator RadioGroupItem displayed in the radioOperatorForm.

Returns:
String

setRangeSeparator

public void setRangeSeparator(String rangeSeparator)
                       throws IllegalStateException
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.

Parameters:
rangeSeparator - Default value is "and"
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getRangeSeparator

public 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.

Returns:
String

getRemoveButton

public ImgButton getRemoveButton()
                          throws IllegalStateException
The removal ImgButton that appears before each clause if showRemoveButton is set.

For an overview of how to use and configure AutoChildren, see Using AutoChildren.

Returns:
ImgButton
Throws:
IllegalStateException - if this widget has not yet been rendered.

setRemoveButtonPrompt

public void setRemoveButtonPrompt(String removeButtonPrompt)
                           throws IllegalStateException
The hover prompt text for the remove button.

Parameters:
removeButtonPrompt - Default value is "Remove"
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getRemoveButtonPrompt

public String getRemoveButtonPrompt()
The hover prompt text for the remove button.

Returns:
String

setRetainValuesAcrossFields

public void setRetainValuesAcrossFields(Boolean retainValuesAcrossFields)
Dictates whether values entered by a user should be retained in the value fields when a different field is selected. Default value is true.

Note that, when switching between fields that have an optionDataSource or valueMap, this property is ignored and the values are never retained.

Parameters:
retainValuesAcrossFields - Default value is true

getRetainValuesAcrossFields

public Boolean getRetainValuesAcrossFields()
Dictates whether values entered by a user should be retained in the value fields when a different field is selected. Default value is true.

Note that, when switching between fields that have an optionDataSource or valueMap, this property is ignored and the values are never retained.

Returns:
Boolean

setSaveOnEnter

public void setSaveOnEnter(Boolean saveOnEnter)
                    throws IllegalStateException
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.

Parameters:
saveOnEnter - Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getSaveOnEnter

public 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.

Returns:
Boolean

setShowAddButton

public void setShowAddButton(Boolean showAddButton)
                      throws IllegalStateException
If set, a button will be shown underneath all current clauses allowing a new clause to be added.

Parameters:
showAddButton - Default value is true
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getShowAddButton

public Boolean getShowAddButton()
If set, a button will be shown underneath all current clauses allowing a new clause to be added.

Returns:
Boolean

setShowFieldTitles

public void setShowFieldTitles(Boolean showFieldTitles)
                        throws IllegalStateException
If true (the default), show field titles in the drop-down box used to select a field for querying. If false, show actual field names instead.

Parameters:
showFieldTitles - Default value is true
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getShowFieldTitles

public Boolean getShowFieldTitles()
If true (the default), show field titles in the drop-down box used to select a field for querying. If false, show actual field names instead.

Returns:
Boolean

setShowModeSwitcher

public void setShowModeSwitcher(Boolean showModeSwitcher)
                         throws IllegalStateException
When enabled allows FilterBuilder in topOperatorAppearance:"radio" or topOperatorAppearance:"bracket" mode to be switch to the other view by the user. "radio" mode is considered simple where "bracket" mode is advanced mode.

Note that when switching from "bracket" to "radio" mode any entered criteria will be flattened by calling DataSource.flattenCriteria. If the criteria cannot be flattened without losing symantics (see DataSource.canFlattenCriteria) the user is prompted to confirm.

Parameters:
showModeSwitcher - Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created
See Also:
setModeSwitcherSimpleMessage(java.lang.String), setModeSwitcherAdvancedMessage(java.lang.String), setModeSwitcherFlattenWarningMessage(java.lang.String)

getShowModeSwitcher

public Boolean getShowModeSwitcher()
When enabled allows FilterBuilder in topOperatorAppearance:"radio" or topOperatorAppearance:"bracket" mode to be switch to the other view by the user. "radio" mode is considered simple where "bracket" mode is advanced mode.

Note that when switching from "bracket" to "radio" mode any entered criteria will be flattened by calling DataSource.flattenCriteria. If the criteria cannot be flattened without losing symantics (see DataSource.canFlattenCriteria) the user is prompted to confirm.

Returns:
Boolean
See Also:
getModeSwitcherSimpleMessage(), getModeSwitcherAdvancedMessage(), getModeSwitcherFlattenWarningMessage()

setShowRemoveButton

public void setShowRemoveButton(Boolean showRemoveButton)
                         throws IllegalStateException
If set, a button will be shown for each clause allowing it to be removed.

Parameters:
showRemoveButton - Default value is true
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getShowRemoveButton

public Boolean getShowRemoveButton()
If set, a button will be shown for each clause allowing it to be removed.

Returns:
Boolean

setShowSelectionCheckbox

public void setShowSelectionCheckbox(Boolean showSelectionCheckbox)
                              throws IllegalStateException
If true, causes a CheckboxItem to appear to the left of each clause in "inline" 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".

Parameters:
showSelectionCheckbox - Default value is false
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getShowSelectionCheckbox

public Boolean getShowSelectionCheckbox()
If true, causes a CheckboxItem to appear to the left of each clause in "inline" 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".

Returns:
Boolean

setShowSubClauseButton

public void setShowSubClauseButton(Boolean showSubClauseButton)
                            throws IllegalStateException
Whether to show a button that allows the user to add subclauses. Defaults to false if the TopOperatorAppearance is "radio" or "inline", true in all other cases.

Parameters:
showSubClauseButton - Default value is See Description
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getShowSubClauseButton

public Boolean getShowSubClauseButton()
Whether to show a button that allows the user to add subclauses. Defaults to false if the TopOperatorAppearance is "radio" or "inline", true in all other cases.

Returns:
Boolean

setSortFields

public void setSortFields(Boolean sortFields)
                   throws IllegalStateException
Should the FieldPicker items be sorted alphabetically in the drop down list.

Parameters:
sortFields - Default value is true
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getSortFields

public Boolean getSortFields()
Should the FieldPicker items be sorted alphabetically in the drop down list.

Returns:
Boolean

getSubClauseButton

public IButton getSubClauseButton()
                           throws IllegalStateException
Button allowing the user to add subclauses grouped by a LogicalOperator.

For an overview of how to use and configure AutoChildren, see Using AutoChildren.

Returns:
IButton
Throws:
IllegalStateException - if this widget has not yet been rendered.

setSubClauseButtonPrompt

public void setSubClauseButtonPrompt(String subClauseButtonPrompt)
                              throws IllegalStateException
The hover prompt text for the subClauseButton.

Parameters:
subClauseButtonPrompt - Default value is "Add Subclause"
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getSubClauseButtonPrompt

public String getSubClauseButtonPrompt()
The hover prompt text for the subClauseButton.

Returns:
String

setSubClauseButtonTitle

public void setSubClauseButtonTitle(String subClauseButtonTitle)
                             throws IllegalStateException
The title of the subClauseButton

Parameters:
subClauseButtonTitle - Default value is "+()"
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getSubClauseButtonTitle

public String getSubClauseButtonTitle()
The title of the subClauseButton

Returns:
String

setTopOperator

public void setTopOperator(LogicalOperator topOperator)
Default logical operator for all top-level clauses in the FilterBuilder.

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.

Parameters:
topOperator - new top-level operator. Default value is "and"

getTopOperator

public LogicalOperator getTopOperator()
Default logical operator for all top-level clauses in the FilterBuilder.

May be able to be changed by the user via the UI, according to TopOperatorAppearance.

Returns:
LogicalOperator

getTopOperatorForm

public DynamicForm getTopOperatorForm()
                               throws IllegalStateException
With TopOperatorAppearance "bracket" and "inline", a form that appears to the left of the stack of clauses and allows picking the LogicalOperator for the overall FilterBuilder (or for that specific FilterClause, in the case of "inline")

By default, consists of a CheckboxItem if showSelectionCheckbox is true, and a simple SelectItem containing the available logical operators.

If this FilterBuilder shows nested sub-clauses, the same defaults will be applied to the top-operator item for each sub-clause.

For an overview of how to use and configure AutoChildren, see Using AutoChildren.

Returns:
DynamicForm
Throws:
IllegalStateException - if this widget has not yet been rendered.

getTopOperatorItem

public SelectItem getTopOperatorItem()
                              throws IllegalStateException
Automatically generated SelectItem autoChild shown in the topOperatorForm. Developers may customize this item using the standard autoChild pattern (by modifying topOperatorItemDefaults and topOperatorItemProperties).

If this FilterBuilder shows nested sub-clauses, the same defaults will be applied to the top-operator item for each sub-clause.

For an overview of how to use and configure AutoChildren, see Using AutoChildren.

Returns:
SelectItem
Throws:
IllegalStateException - if this widget has not yet been rendered.

setTopOperatorItemWidth

public void setTopOperatorItemWidth(int topOperatorItemWidth)
                             throws IllegalStateException
Width for the topOperatorItem autoChild.

Parameters:
topOperatorItemWidth - Default value is "*"
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getTopOperatorItemWidth

public int getTopOperatorItemWidth()
Width for the topOperatorItem autoChild.

Returns:
int

setTopOperatorItemWidth

public void setTopOperatorItemWidth(String topOperatorItemWidth)
                             throws IllegalStateException
Width for the topOperatorItem autoChild.

Parameters:
topOperatorItemWidth - Default value is "*"
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getTopOperatorItemWidthAsString

public String getTopOperatorItemWidthAsString()
Width for the topOperatorItem autoChild.

Returns:
String

setTopOperatorOptions

public void setTopOperatorOptions(OperatorId... topOperatorOptions)
                           throws IllegalStateException
Logical operators to allow for TopOperatorAppearances of "radio" and "bracket".

Note that this list may be further limited according to the available operators returned by the DataSource.

Parameters:
topOperatorOptions - Default value is ["and", "or", "not"]
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getTopOperatorOptions

public OperatorId[] getTopOperatorOptions()
Logical operators to allow for TopOperatorAppearances of "radio" and "bracket".

Note that this list may be further limited according to the available operators returned by the DataSource.

Returns:
OperatorId...

setTopOperatorTitle

public void setTopOperatorTitle(String topOperatorTitle)
                         throws IllegalStateException
The title for the left-aligned Operator selectItem in the topOperatorForm.

Parameters:
topOperatorTitle - Default value is "Clause Operator"
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getTopOperatorTitle

public String getTopOperatorTitle()
The title for the left-aligned Operator selectItem in the topOperatorForm.

Returns:
String

setValidateOnChange

public void setValidateOnChange(Boolean validateOnChange)
                         throws IllegalStateException
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). No other validation is carried out. If you switch this property off, it is still possible to validate the FilterBuilder by calling FilterBuilder.validate from your own code.

Parameters:
validateOnChange - Default value is true
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getValidateOnChange

public 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). No other validation is carried out. If you switch this property off, it is still possible to validate the FilterBuilder by calling FilterBuilder.validate from your own code.

Returns:
Boolean

setValueItemWidth

public void setValueItemWidth(Integer valueItemWidth)
                       throws IllegalStateException
Width for the value-chooser formItem displayed in clauses within this FilterBuilder. Note that depending on the selected operator type, this item may not be displayed, or may have different characteristics. See FilterBuilder.getValueFieldProperties for information on customizing the value item.

Parameters:
valueItemWidth - Default value is 150
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getValueItemWidth

public Integer getValueItemWidth()
Width for the value-chooser formItem displayed in clauses within this FilterBuilder. Note that depending on the selected operator type, this item may not be displayed, or may have different characteristics. See FilterBuilder.getValueFieldProperties for information on customizing the value item.

Returns:
Integer

setValueItemWidth

public void setValueItemWidth(String valueItemWidth)
                       throws IllegalStateException
Width for the value-chooser formItem displayed in clauses within this FilterBuilder. Note that depending on the selected operator type, this item may not be displayed, or may have different characteristics. See FilterBuilder.getValueFieldProperties for information on customizing the value item.

Parameters:
valueItemWidth - Default value is 150
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getValueItemWidthAsString

public String getValueItemWidthAsString()
Width for the value-chooser formItem displayed in clauses within this FilterBuilder. Note that depending on the selected operator type, this item may not be displayed, or may have different characteristics. See FilterBuilder.getValueFieldProperties for information on customizing the value item.

Returns:
String

addClause

public void addClause(FilterClause filterClause)
Add a new 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.

Parameters:
filterClause - A FilterClause instance

addCriterion

public void addCriterion(Criterion criterion)
Add a new criterion, including recursively adding sub-criteria for a criterion that contains other criteria.

Parameters:
criterion - new criterion to be added

clearCriteria

public void clearCriteria()
Clear all current criteria.


addFilterChangedHandler

public HandlerRegistration addFilterChangedHandler(FilterChangedHandler handler)
Add a filterChanged handler.

Handler fired when there is a change() event fired on any FormItem within the filterBuilder.

Specified by:
addFilterChangedHandler in interface HasFilterChangedHandlers
Parameters:
handler - the filterChanged handler
Returns:
HandlerRegistration used to remove this handler

getEditorType

public String getEditorType(DataSourceField field,
                            OperatorId operatorId)
Returns the type of editor to use for the field.

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.

Parameters:
field - DataSourceField definition
operatorId - OperatorId for the chosen operator
Returns:
Smart GWT class to use (must be subclass of FormItem)

getSelectedClauses

public FilterClause[] getSelectedClauses()
Returns the list of this FilterBuilder's FilterClauses that are currently selected. A clause is "selected" if the user has checked the checkbox next to it; therefore, this method always returns an empty list unless the showSelectionCheckbox property is set. This method is only applicable where TopOperatorAppearance is "inline" (because that is the only appearance that supports showSelectionCheckbox)

Returns:
The list of selected clauses

addSearchHandler

public HandlerRegistration addSearchHandler(SearchHandler handler)
Add a search 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.

Specified by:
addSearchHandler in interface HasSearchHandlers
Parameters:
handler - the search handler
Returns:
HandlerRegistration used to remove this handler

validate

public Boolean validate()
Validate the clauses of this FilterBuilder.

Returns:
true if all clauses are valid, false otherwise

setDefaultProperties

public static void setDefaultProperties(FilterBuilder filterBuilderProperties)
Class level method to set the default properties of this class. If set, then all existing and subsequently created instances of this class will automatically have default properties corresponding to the properties set on the SmartGWT class instance passed to this function before its underlying SmartClient JS object was created. This is a powerful feature that eliminates the need for users to create a separate hierarchy of subclasses that only alter the default properties of this class. Can also be used for skinning / styling purposes.

Note: This method is intended for setting default attributes only and will affect 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. Calling this method after instances have been created can result in undefined behavior, since it bypasses any setters and a class instance may have already examined a particular property and not be expecting any changes through this route.

Parameters:
filterBuilderProperties - properties that should be used as new defaults when instances of this class are created

onInit

public void onInit()
Overrides:
onInit in class Layout

onInit_FilterBuilder

protected void onInit_FilterBuilder()

setShowFieldTitles

public void setShowFieldTitles(boolean showFieldTitles)
                        throws IllegalStateException
If true (the default), show field titles in the drop-down box used to select a field for querying. If false, show actual field names instead.

Parameters:
showFieldTitles - showFieldTitles default is true
Throws:
IllegalStateException - this property cannot be changed after the component has been created

setDataSource

public void setDataSource(DataSource dataSource)
DataSource this filter should use for field definitions and available ${isc.DocUtils.linkForRef('object:Operator')}s.

Parameters:
dataSource - dataSource Default value is null

getDataSource

public DataSource getDataSource()
The DataSource that this component should bind to for default fields and for performing DSRequest.

Can be specified as either a DataSource instance or the String ID of a DataSource.

Returns:
DataSource

setTopOperatorAppearance

public void setTopOperatorAppearance(TopOperatorAppearance topOperatorAppearance)
                              throws IllegalStateException
How to display and edit the topOperator for this FilterBuilder.

See TopOperatorAppearance for a list of options.

Parameters:
topOperatorAppearance - topOperatorAppearance Default value is "bracket"
Throws:
IllegalStateException - this property cannot be changed after the component has been created

setCriteria

public void setCriteria(AdvancedCriteria criteria)
Initial 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.

Parameters:
criteria - new criteria. Pass null or {} to effectively reset the filterBuilder to it's initial state when no criteria are specified. Default value is null

getCriteria

public AdvancedCriteria getCriteria()
Get the edited criteria entered by the user.

Returns:
Get the criteria entered by the user.

getCriteria

public AdvancedCriteria getCriteria(boolean includeEmptyValues)
Get the edited criteria entered by the user.

Parameters:
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.
Returns:
Get the criteria entered by the user.

removeClause

public void removeClause(FilterClause clause)
Remove a clause this FilterBuilder is currently showing.

Parameters:
clause - clause as retrieved from filterBuilder.clauses

getMembers

public Canvas[] getMembers()
Description copied from class: Layout
An array of canvases that will be contained within this layout. You can set the following properties on these canvases (in addition to the standard component properties): Height and width settings found on members are interpreted by the Layout according to the layout policy.

Overrides:
getMembers in class Layout
Returns:
Get the Array of members.

getValueFieldProperties

public FormItem getValueFieldProperties(FieldType type,
                                        String fieldName,
                                        OperatorId operatorId,
                                        ValueItemType itemType,
                                        String fieldType)
Override to return properties for the FormItem(s) used for the "value" field displayed within clauses within this filterBuilder.

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.

Parameters:
type - type of the DataSource field for this filter row. Note that for DataSourceSimpleTypeField SimpleType based DataSource fields this attribute will be null
fieldName - name of the DataSource field for this filter row
operatorId - OperatorId for the chosen operator
itemType - 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
Returns:
properties for the value field

setLogicalStructure

public com.smartgwt.logicalstructure.core.LogicalStructureObject setLogicalStructure(com.smartgwt.logicalstructure.widgets.form.FilterBuilderLogicalStructure s)

getLogicalStructure

public com.smartgwt.logicalstructure.core.LogicalStructureObject getLogicalStructure()
Specified by:
getLogicalStructure in interface LogicalStructure
Overrides:
getLogicalStructure in class Layout