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_CmsSelectBoxUiBinder
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
Nested 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_selectorState
Fields 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 TypeMethodDescriptionvoid
addOption
(CmsLabelSelectCell cell) Adds a new select option to the select box.protected void
close()
Internal method which is called when the selector is closed.protected CmsLabelSelectCell
createUnknownOption
(String value) Internal method to create a select option for an unknown value.boolean
Returns whether the select options are being displayed below or above the widget.protected void
filterCells
(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.FocusPanel
Gets the opener.static void
Initializes this class.protected void
The implementation of this method should initialize the opener of the select box.void
onBrowserEvent
(com.google.gwt.user.client.Event event) protected void
open()
Internal method which is called when the selector is opened.void
setAutoHideParent
(I_CmsAutoHider autoHideParent) Call this when auto hiding parents are shown.void
setEnabled
(boolean enabled) Enables or disables the widget.void
Sets the select options.void
Sets the title for a select option.protected void
truncateOpener
(String prefix, int width) Abstract method whose implementation should truncate the opener widget(s).protected void
updateOpener
(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, truncate
Methods inherited from class com.google.gwt.user.client.ui.Composite
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, render, render, resolvePotentialElement, setWidget
Methods 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, unsinkEvents
Methods 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, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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_CmsSelectBox
Adds a new select option to the select box.- Overrides:
addOption
in classA_CmsSelectBox<CmsLabelSelectCell>
- Parameters:
cell
- the widget representing the select option- See Also:
-
displayingAbove
Description copied from class:A_CmsSelectBox
Returns whether the select options are being displayed below or above the widget.- Overrides:
displayingAbove
in classA_CmsSelectBox<CmsLabelSelectCell>
- Returns:
true
in case the select options are displayed above the widget- See Also:
-
getApparentValue
Description copied from interface:I_CmsFormWidget
Returns the "apparent value", i.e. either the real value if available, or else the ghost value if available, or null otherwise.- Specified by:
getApparentValue
in 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:
onBrowserEvent
in interfacecom.google.gwt.user.client.EventListener
- Overrides:
onBrowserEvent
in classA_CmsSelectBox<CmsLabelSelectCell>
- See Also:
-
setAutoHideParent
Description copied from interface:I_CmsFormWidget
Call this when auto hiding parents are shown.- Specified by:
setAutoHideParent
in interfaceI_CmsFormWidget
- Parameters:
autoHideParent
- the auto hide parent- See Also:
-
setEnabled
Description copied from interface:I_CmsFormWidget
Enables or disables the widget.- Specified by:
setEnabled
in interfaceI_CmsFormWidget
- Overrides:
setEnabled
in 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_CmsSelectBox
Internal method which is called when the selector is closed.- Overrides:
close
in classA_CmsSelectBox<CmsLabelSelectCell>
- See Also:
-
createUnknownOption
Description copied from class:A_CmsSelectBox
Internal method to create a select option for an unknown value.- Specified by:
createUnknownOption
in 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_CmsSelectBox
The implementation of this method should initialize the opener of the select box.- Specified by:
initOpener
in classA_CmsSelectBox<CmsLabelSelectCell>
- See Also:
-
open
Description copied from class:A_CmsSelectBox
Internal method which is called when the selector is opened.- Overrides:
open
in classA_CmsSelectBox<CmsLabelSelectCell>
- See Also:
-
truncateOpener
Description copied from class:A_CmsSelectBox
Abstract method whose implementation should truncate the opener widget(s).- Specified by:
truncateOpener
in classA_CmsSelectBox<CmsLabelSelectCell>
- Parameters:
prefix
- the text metrics prefixwidth
- the widget width- See Also:
-
updateOpener
Description copied from class:A_CmsSelectBox
The implementation of this method should update the opener when a new value is selected by the user.- Specified by:
updateOpener
in classA_CmsSelectBox<CmsLabelSelectCell>
- Parameters:
newValue
- the value selected by the user- See Also:
-