Class CmsAttributeSelectWidget

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.acacia.client.widgets.CmsAttributeSelectWidget
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.TakesValue<String>, com.google.gwt.user.client.ui.HasValue<String>, com.google.gwt.user.client.ui.HasVisibility, com.google.gwt.user.client.ui.IsRenderable, com.google.gwt.user.client.ui.IsWidget, I_CmsEditWidget

public class CmsAttributeSelectWidget extends com.google.gwt.user.client.ui.Composite implements I_CmsEditWidget
An attribute select widget acts as a select widget and consists of several attribute filter select boxes and one main select box, such that choosing values from the attribute filters restricts the available options in the main select box to those which have a matching value for every filter attribute.

All data related to the options and filter attributes must be passed into the constructor, this widget does not use any RPC calls.

  • 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
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected com.google.gwt.user.client.ui.FlowPanel
    The panel containing everything else.

    Fields inherited from class com.google.gwt.user.client.ui.UIObject

    DEBUG_ID_PREFIX
  • Constructor Summary

    Constructors
    Constructor
    Description
    CmsAttributeSelectWidget(org.opencms.gwt.shared.attributeselect.I_CmsAttributeSelectData data)
    Creates a new instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.google.gwt.event.shared.HandlerRegistration
    addFocusHandler(com.google.gwt.event.dom.client.FocusHandler handler)
    Adds the focus handler.
    com.google.gwt.event.shared.HandlerRegistration
    addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<String> handler)
    Adds the value change handler.
    void
    Represents a value change event.
    protected Map<String,String>
    Gets the currently selected attribute filters.
     
    protected void
    Changes the set of available options in the main select box to those which match the currently selected attribute filters.
    boolean
    Returns if the widget is active.
    void
    This method is called when a widget is attached to the browser's document.
    boolean
    owns(com.google.gwt.dom.client.Element element)
    Returns true if the element should be logically counted as part of the widget for the purpose of determining whether a mouse click is "outside".
    void
    setActive(boolean active)
    Sets the widget active/inactive.
    void
    Sets the name of input fields.
    void
     
    void
    setValue(String value, boolean fireEvent)
     

    Methods inherited from class com.google.gwt.user.client.ui.Composite

    claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, 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, onLoad, onUnload, 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

    Methods inherited from interface org.opencms.acacia.client.widgets.I_CmsEditWidget

    shouldSetDefaultWhenDisabled

    Methods inherited from interface com.google.gwt.user.client.ui.IsWidget

    asWidget
  • Field Details

    • m_root

      protected com.google.gwt.user.client.ui.FlowPanel m_root
      The panel containing everything else.
  • Constructor Details

    • CmsAttributeSelectWidget

      public CmsAttributeSelectWidget(org.opencms.gwt.shared.attributeselect.I_CmsAttributeSelectData data)
      Creates a new instance.
      Parameters:
      data - the widget data
  • Method Details

    • addFocusHandler

      public com.google.gwt.event.shared.HandlerRegistration addFocusHandler(com.google.gwt.event.dom.client.FocusHandler handler)
      Adds the focus handler.
      Specified by:
      addFocusHandler in interface com.google.gwt.event.dom.client.HasFocusHandlers
      Parameters:
      handler - the handler
      Returns:
      the handler registration
      See Also:
      • HasFocusHandlers.addFocusHandler(com.google.gwt.event.dom.client.FocusHandler)
    • addValueChangeHandler

      public com.google.gwt.event.shared.HandlerRegistration addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<String> handler)
      Adds the value change handler.
      Specified by:
      addValueChangeHandler in interface com.google.gwt.event.logical.shared.HasValueChangeHandlers<String>
      Specified by:
      addValueChangeHandler in interface I_CmsEditWidget
      Parameters:
      handler - the handler
      Returns:
      the handler registration
      See Also:
      • HasValueChangeHandlers.addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler)
    • fireChangeEvent

      public void fireChangeEvent()
      Represents a value change event.

    • getValue

      public String getValue()
      Specified by:
      getValue in interface com.google.gwt.user.client.ui.HasValue<String>
      Specified by:
      getValue in interface com.google.gwt.user.client.TakesValue<String>
      See Also:
      • HasValue.getValue()
    • isActive

      public boolean isActive()
      Description copied from interface: I_CmsEditWidget
      Returns if the widget is active.

      Specified by:
      isActive in interface I_CmsEditWidget
      Returns:
      true if the widget is active
      See Also:
    • onAttachWidget

      public void onAttachWidget()
      Description copied from interface: I_CmsEditWidget
      This method is called when a widget is attached to the browser's document.

      It needs to call the Widget.onAttach() method.

      Specified by:
      onAttachWidget in interface I_CmsEditWidget
      See Also:
    • owns

      public boolean owns(com.google.gwt.dom.client.Element element)
      Description copied from interface: I_CmsEditWidget
      Returns true if the element should be logically counted as part of the widget for the purpose of determining whether a mouse click is "outside". For example, this is needed if the widget uses a popup.
      Specified by:
      owns in interface I_CmsEditWidget
      Parameters:
      element - the element to check
      Returns:
      true if the element counts as part of the widget
      See Also:
    • setActive

      public void setActive(boolean active)
      Description copied from interface: I_CmsEditWidget
      Sets the widget active/inactive.

      Specified by:
      setActive in interface I_CmsEditWidget
      Parameters:
      active - true to activate the widget
      See Also:
    • setName

      public void setName(String name)
      Description copied from interface: I_CmsEditWidget
      Sets the name of input fields.

      Specified by:
      setName in interface I_CmsEditWidget
      Parameters:
      name - of the input field
      See Also:
    • setValue

      public void setValue(String value)
      Specified by:
      setValue in interface com.google.gwt.user.client.ui.HasValue<String>
      Specified by:
      setValue in interface com.google.gwt.user.client.TakesValue<String>
      See Also:
      • HasValue.setValue(java.lang.Object)
    • setValue

      public void setValue(String value, boolean fireEvent)
      Specified by:
      setValue in interface com.google.gwt.user.client.ui.HasValue<String>
      Specified by:
      setValue in interface I_CmsEditWidget
      See Also:
    • getFilterAttributes

      Gets the currently selected attribute filters.
      Returns:
      a map with attribute names as its keys and attribute values as its values
    • handleFilterChange

      protected void handleFilterChange()
      Changes the set of available options in the main select box to those which match the currently selected attribute filters.