Class CmsComboBox

  • All Implemented Interfaces:
    com.google.gwt.event.dom.client.HasFocusHandlers, com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.logical.shared.HasValueChangeHandlers<java.lang.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, I_CmsHasGhostValue
    Direct Known Subclasses:
    CmsPropertyComboBox

    public class CmsComboBox
    extends A_CmsSelectBox<CmsLabelSelectCell>
    implements I_CmsHasInit, I_CmsHasGhostValue
    Widget for selecting one of multiple items from a drop-down list which opens after the user clicks on the widget.

    Since:
    8.0.0
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject

        com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
    • Constructor Summary

      Constructors 
      Constructor Description
      CmsComboBox()
      Default constructor.
      CmsComboBox​(java.util.Map<java.lang.String,​java.lang.String> items)
      Constructs a new select box from a map.
      CmsComboBox​(java.util.Map<java.lang.String,​java.lang.String> items, boolean addNullOption)
      Creates a new select box, with the option of adding a "not selected" choice.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addOption​(java.lang.String value, java.lang.String text)
      Adds a new selection cell.
      com.google.gwt.event.shared.HandlerRegistration addValueChangeHandler​(com.google.gwt.event.logical.shared.ValueChangeHandler<java.lang.String> handler)  
      void closeSelector()  
      protected CmsLabelSelectCell createUnknownOption​(java.lang.String value)
      Internal method to create a select option for an unknown value.
      java.lang.String getApparentValue()
      Returns the "apparent value", i.e.
      java.lang.Object getFormValue()
      Gets the selected/entered value from the widget.
      java.lang.String getFormValueAsString()
      Gets the current value of the widget as a string.
      com.google.gwt.user.client.ui.Panel getMainPanel()
      Returns the mainpanel of this widget.
      com.google.gwt.user.client.ui.FocusPanel getOpener()
      Returns the opener of this widget.
      com.google.gwt.user.client.ui.TextBox getTextBox()
      Returns the text box of this widget.
      protected java.lang.String getTitle​(java.lang.String option, java.lang.String defaultValue)
      Helper method to get the title for a given select option.
      static void initClass()
      Initializes this class.
      protected void initOpener()
      The implementation of this method should initialize the opener of the select box.
      protected void onLoad()  
      void openSelector()  
      void selectValue​(java.lang.String value)
      Helper method to set the current selected option.
      void setAutoHideParent​(I_CmsAutoHider autoHideParent)
      Call this when auto hiding parents are shown.
      void setFormValue​(java.lang.Object value)
      Sets the form value of this select box.
      void setFormValueAsString​(java.lang.String formValue)
      Sets the current value of the widget as a string.
      void setGhostMode​(boolean ghostMode)
      Enables or disables ghost mode, if possible.
      void setGhostValue​(java.lang.String value, boolean ghostMode)
      Sets the "ghost value" of the widget and optionally sets it to "ghost mode".
      void setItems​(java.util.Map<java.lang.String,​java.lang.String> items)
      Sets the items using a map from option values to label texts.
      void setText​(java.lang.String text)
      Sets the title for a select option.
      void setTextForNullSelection​(java.lang.String text)
      Sets the text that is used for the "not selected" option.
      void setTitle​(java.lang.String option, java.lang.String title)
      Sets the title for a select option.
      void truncateOpener​(java.lang.String prefix, int width)
      Abstract method whose implementation should truncate the opener widget(s).
      protected void updateCell​(CmsLabelSelectCell cell)
      Updates the select cell.
      void updateCells()
      Updates the select cells.
      protected void updateOpener​(java.lang.String newValue)
      The implementation of this method should update the opener when a new value is selected by the user.
      protected void updateStyle()
      This method should be used to make changes to the CSS style of the select box when the value changes.
      • 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