Class CmsFormatterSelectWidget

  • All Implemented Interfaces:,,<java.lang.String>,,,<java.lang.String>,<java.lang.String>,,,, I_CmsEditWidget, I_CmsHasDisplayDirection

    public class CmsFormatterSelectWidget
    implements I_CmsEditWidget, I_CmsHasDisplayDirection
    Select widget which uses other values from the content as select options.

    This works as follows: The widget is given a configuration consisting of three pipe-separated OpenCms content value paths. The first path is used to select a set of nested content values. The second and third paths are relative to the first path and are used to select a select option and a select option display text from the nested contents matching the first path. Note that if you omit indexes on a component of the first path, all indexes will be matched. The widget attaches event listeners to the editor so it can dynamically update the list of select options when the content changes.

    • Nested Class Summary

      • Nested classes/interfaces inherited from class,
    • Field Summary

      Modifier and Type Field Description
      protected CmsFilterSelectBox m_selectBox
      The global select box.
      • Fields inherited from class

    • Constructor Summary

      Constructor Description
      CmsFormatterSelectWidget​(java.lang.String configuration)
      Creates a new widget instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description addFocusHandler​( handler) addValueChangeHandler​(<java.lang.String> handler)  
      void fireChangeEvent()
      Represents a value change event.
      I_CmsHasDisplayDirection.Direction getDisplayingDirection()
      Returns the display direction.
      java.lang.String getValue()  
      boolean isActive()
      Returns if the widget is active.
      void onAttachWidget()
      This method is called when a widget is attached to the browser's document.
      void onLoad()  
      boolean owns​( 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 setName​(java.lang.String name)
      Sets the name of input fields.
      void setValue​(java.lang.String value)  
      void setValue​(java.lang.String value, boolean fireEvents)  
      void update​(org.opencms.acacia.shared.CmsEntity entity)
      Updates the select options from the given entity.
      • Methods inherited from class

        claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidget
      • Methods inherited from class

        addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
      • Methods inherited from class

        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

      • Methods inherited from interface

    • Constructor Detail

      • CmsFormatterSelectWidget

        public CmsFormatterSelectWidget​(java.lang.String configuration)
        Creates a new widget instance.

        configuration - the widget configuration
    • Method Detail

      • addFocusHandler

        public addFocusHandler​( handler)
        Specified by:
        addFocusHandler in interface
        See Also:
      • addValueChangeHandler

        public addValueChangeHandler​(<java.lang.String> handler)
        Specified by:
        addValueChangeHandler in interface<java.lang.String>
        Specified by:
        addValueChangeHandler in interface I_CmsEditWidget
        See Also:
      • fireChangeEvent

        public void fireChangeEvent()
        Represents a value change event.

        Please edit the blog entry text.

      • getValue

        public java.lang.String getValue()
        Specified by:
        getValue in interface<java.lang.String>
        Specified by:
        getValue in interface<java.lang.String>
        See Also:
      • onLoad

        public void onLoad()
        onLoad in class
        See Also:
      • owns

        public boolean owns​( 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
        element - the element to check
        true if the element counts as part of the widget
        See Also:
      • setValue

        public void setValue​(java.lang.String value)
        Specified by:
        setValue in interface<java.lang.String>
        Specified by:
        setValue in interface<java.lang.String>
        See Also:
      • setValue

        public void setValue​(java.lang.String value,
                             boolean fireEvents)
        Specified by:
        setValue in interface<java.lang.String>
        Specified by:
        setValue in interface I_CmsEditWidget
        See Also:
        HasValue.setValue(java.lang.Object, boolean)
      • update

        public void update​(org.opencms.acacia.shared.CmsEntity entity)
        Updates the select options from the given entity.

        entity - a top-level content entity