Package org.opencms.gwt.client.ui.input
Class CmsFilterSelectBox
java.lang.Object
com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.Composite
org.opencms.gwt.client.ui.input.A_CmsSelectBox<CmsLabelSelectCell>
org.opencms.gwt.client.ui.input.CmsFilterSelectBox
- All Implemented Interfaces:
com.google.gwt.event.dom.client.HasFocusHandlers,com.google.gwt.event.logical.shared.HasAttachHandlers,com.google.gwt.event.logical.shared.HasValueChangeHandlers<String>,com.google.gwt.event.shared.HasHandlers,com.google.gwt.user.client.EventListener,com.google.gwt.user.client.ui.HasVisibility,com.google.gwt.user.client.ui.IsRenderable,com.google.gwt.user.client.ui.IsWidget,I_CmsHasInit,I_CmsTruncable,I_CmsFormWidget
Select box that allows client-side filtering for its options.
Filtering is done by a case-insensitive substring test on the user-readable select option texts.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opencms.gwt.client.ui.input.A_CmsSelectBox
A_CmsSelectBox.I_CmsSelectBoxUiBinderNested 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.DebugIdImplEnabledNested classes/interfaces inherited from interface org.opencms.gwt.client.ui.input.I_CmsFormWidget
I_CmsFormWidget.FieldType -
Field Summary
FieldsFields inherited from class org.opencms.gwt.client.ui.input.A_CmsSelectBox
CSS, m_error, m_eventBus, m_mousewheelRegistration, m_openClose, m_opener, m_panel, m_popup, m_selectBoxState, m_selectCells, m_selectedValue, m_selector, m_selectorStateFields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance.CmsFilterSelectBox(Map<String, String> options) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddOption(CmsLabelSelectCell cell) Adds a new select option to the select box.protected voidclose()Internal method which is called when the selector is closed.protected CmsLabelSelectCellcreateUnknownOption(String value) Internal method to create a select option for an unknown value.booleanReturns whether the select options are being displayed below or above the widget.protected voidfilterCells(String filter) Updates the visibility of select options based on the given filter string.Returns the "apparent value", i.e.getItems()Gets the selection items as a map (the values are map keys, and the labels are the corresponding map values).com.google.gwt.user.client.ui.FocusPanelGets the opener.static voidInitializes this class.protected voidThe implementation of this method should initialize the opener of the select box.voidonBrowserEvent(com.google.gwt.user.client.Event event) protected voidopen()Internal method which is called when the selector is opened.voidsetAutoHideParent(I_CmsAutoHider autoHideParent) Call this when auto hiding parents are shown.voidsetEnabled(boolean enabled) Enables or disables the widget.voidSets the select options.voidSets the title for a select option.protected voidtruncateOpener(String prefix, int width) Abstract method whose implementation should truncate the opener widget(s).protected voidupdateOpener(String newValue) The implementation of this method should update the opener when a new value is selected by the user.Methods inherited from class org.opencms.gwt.client.ui.input.A_CmsSelectBox
addFocusHandler, addValueChangeHandler, addWidget, clearItems, doClickOpener, getFieldType, getFormValue, getFormValueAsString, getPopupHeight, getSelectorPopup, initPreferredPopupWidth, isEnabled, onDetach, onFocus, onLoad, onUnload, onValueSelect, onValueSelect, removeWindowResizeHandler, reset, selectValue, setErrorMessage, setFormValue, setFormValue, setFormValueAsString, setPopupResize, truncateMethods inherited from class com.google.gwt.user.client.ui.Composite
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, render, render, resolvePotentialElement, setWidgetMethods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, removeFromParent, setLayoutData, sinkEvents, unsinkEventsMethods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
-
Field Details
-
WIDGET_TYPE
The widget type identifier.- See Also:
-
-
Constructor Details
-
CmsFilterSelectBox
public CmsFilterSelectBox()Creates a new instance. -
CmsFilterSelectBox
Creates a new instance.- Parameters:
options- the select options
-
-
Method Details
-
initClass
Initializes this class. -
addOption
Description copied from class:A_CmsSelectBoxAdds a new select option to the select box.- Overrides:
addOptionin classA_CmsSelectBox<CmsLabelSelectCell>- Parameters:
cell- the widget representing the select option- See Also:
-
displayingAbove
Description copied from class:A_CmsSelectBoxReturns whether the select options are being displayed below or above the widget.- Overrides:
displayingAbovein classA_CmsSelectBox<CmsLabelSelectCell>- Returns:
truein case the select options are displayed above the widget- See Also:
-
getApparentValue
Description copied from interface:I_CmsFormWidgetReturns the "apparent value", i.e. either the real value if available, or else the ghost value if available, or null otherwise.- Specified by:
getApparentValuein interfaceI_CmsFormWidget- Returns:
- the apparent value
- See Also:
-
getItems
Gets the selection items as a map (the values are map keys, and the labels are the corresponding map values).- Returns:
- the selection items as a map
-
getOpener
Gets the opener.- Returns:
- the opener
-
onBrowserEvent
- Specified by:
onBrowserEventin interfacecom.google.gwt.user.client.EventListener- Overrides:
onBrowserEventin classA_CmsSelectBox<CmsLabelSelectCell>- See Also:
-
setAutoHideParent
Description copied from interface:I_CmsFormWidgetCall this when auto hiding parents are shown.- Specified by:
setAutoHideParentin interfaceI_CmsFormWidget- Parameters:
autoHideParent- the auto hide parent- See Also:
-
setEnabled
Description copied from interface:I_CmsFormWidgetEnables or disables the widget.- Specified by:
setEnabledin interfaceI_CmsFormWidget- Overrides:
setEnabledin classA_CmsSelectBox<CmsLabelSelectCell>- Parameters:
enabled- if true, the widget will be enabled, else disabled- See Also:
-
setItems
Sets the select options.- Parameters:
options- the select options
-
setTitle
Sets the title for a select option.- Parameters:
key- the select option keytitle- the title
-
close
Description copied from class:A_CmsSelectBoxInternal method which is called when the selector is closed.- Overrides:
closein classA_CmsSelectBox<CmsLabelSelectCell>- See Also:
-
createUnknownOption
Description copied from class:A_CmsSelectBoxInternal method to create a select option for an unknown value.- Specified by:
createUnknownOptionin classA_CmsSelectBox<CmsLabelSelectCell>- Parameters:
value- the value for which to create the option- Returns:
- the new option
- See Also:
-
filterCells
Updates the visibility of select options based on the given filter string.An option matches the filter if the display text contains the filter string as a substring, without regard for case.
- Parameters:
filter- the filter string
-
initOpener
Description copied from class:A_CmsSelectBoxThe implementation of this method should initialize the opener of the select box.- Specified by:
initOpenerin classA_CmsSelectBox<CmsLabelSelectCell>- See Also:
-
open
Description copied from class:A_CmsSelectBoxInternal method which is called when the selector is opened.- Overrides:
openin classA_CmsSelectBox<CmsLabelSelectCell>- See Also:
-
truncateOpener
Description copied from class:A_CmsSelectBoxAbstract method whose implementation should truncate the opener widget(s).- Specified by:
truncateOpenerin classA_CmsSelectBox<CmsLabelSelectCell>- Parameters:
prefix- the text metrics prefixwidth- the widget width- See Also:
-
updateOpener
Description copied from class:A_CmsSelectBoxThe implementation of this method should update the opener when a new value is selected by the user.- Specified by:
updateOpenerin classA_CmsSelectBox<CmsLabelSelectCell>- Parameters:
newValue- the value selected by the user- See Also:
-