Class CmsMenuButton

    • 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 CmsPushButton m_button
      The menu button.
      protected CmsToolbarPopup m_popup
      The menu content.
      protected com.google.gwt.event.shared.HandlerRegistration m_resizeRegistration
      Registration of the window resize handler.
      • Fields inherited from class com.google.gwt.user.client.ui.UIObject

        DEBUG_ID_PREFIX
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected CmsMenuButton()
      Constructor.
        CmsMenuButton​(java.lang.String buttonText, java.lang.String imageClass)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.google.gwt.event.shared.HandlerRegistration addClickHandler​(com.google.gwt.event.dom.client.ClickHandler handler)  
      protected void autoClose()
      Called on auto close.
      void clear()
      Removes all content from menu.
      void closeMenu()
      Closes the menu and fires the on toggle event.
      void disable​(java.lang.String disabledReason)
      Disables the menu button.
      void enable()
      Enables or disables the button.
      protected CmsPopup getPopup()
      Returns the popup content.
      void hide()
      Hides the menu content as well as the menu connector.
      protected void hideMenu()
      Hides the menu content without altering the button state.
      protected boolean isEnabled()
      Returns if this button is enabled.
      boolean isOpen()
      Returns if the menu is open.
      boolean isOpenRight()
      Returns the isOpenRight.
      void onBrowserEvent​(com.google.gwt.user.client.Event event)  
      void openMenu()
      Opens the menu and fires the on toggle event.
      protected void setButtonDown()
      Sets the button to its 'down state'.
      protected void setButtonUp()
      Sets button to state up, hides menu fragments (not the content pop-up) and fires the toggle event.
      void setEnabled​(boolean enabled)
      Enables or disables the button.
      void setMenuWidget​(com.google.gwt.user.client.ui.Widget widget)
      This will set the menu content widget.
      void setOpenRight​(boolean isOpenRight)
      Sets the isOpenRight.
      void setToolbarMode​(boolean isToolbarMode)
      Sets the isToolbarMode.
      void show()
      Shows the menu content as well as the menu connector.
      • Methods inherited from class com.google.gwt.user.client.ui.Composite

        claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, 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
    • Constructor Detail

      • CmsMenuButton

        @UiConstructor
        public CmsMenuButton​(java.lang.String buttonText,
                             java.lang.String imageClass)
        Constructor.

        Parameters:
        buttonText - the menu button text
        imageClass - the menu button image sprite class
    • Method Detail

      • addClickHandler

        public com.google.gwt.event.shared.HandlerRegistration addClickHandler​(com.google.gwt.event.dom.client.ClickHandler handler)
        Specified by:
        addClickHandler in interface com.google.gwt.event.dom.client.HasClickHandlers
        See Also:
        HasClickHandlers.addClickHandler(com.google.gwt.event.dom.client.ClickHandler)
      • clear

        public void clear()
        Removes all content from menu.

      • closeMenu

        public void closeMenu()
        Closes the menu and fires the on toggle event.

      • disable

        public void disable​(java.lang.String disabledReason)
        Disables the menu button.

        Parameters:
        disabledReason - the reason to set in the button title
      • enable

        public void enable()
        Enables or disables the button.

      • hide

        public void hide()
        Hides the menu content as well as the menu connector.

      • isOpen

        public boolean isOpen()
        Returns if the menu is open.

        Returns:
        true if the menu is opened
      • isOpenRight

        public boolean isOpenRight()
        Returns the isOpenRight.

        Returns:
        the isOpenRight
      • onBrowserEvent

        public void onBrowserEvent​(com.google.gwt.user.client.Event event)
        Specified by:
        onBrowserEvent in interface com.google.gwt.user.client.EventListener
        Overrides:
        onBrowserEvent in class com.google.gwt.user.client.ui.Composite
        See Also:
        Composite.onBrowserEvent(com.google.gwt.user.client.Event)
      • openMenu

        public void openMenu()
        Opens the menu and fires the on toggle event.

      • setEnabled

        public void setEnabled​(boolean enabled)
        Enables or disables the button.

        Parameters:
        enabled - if true, enables the button, else disables it
      • setMenuWidget

        public void setMenuWidget​(com.google.gwt.user.client.ui.Widget widget)
        This will set the menu content widget.

        Parameters:
        widget - the widget to set as content
      • setOpenRight

        public void setOpenRight​(boolean isOpenRight)
        Sets the isOpenRight.

        Parameters:
        isOpenRight - the isOpenRight to set
      • setToolbarMode

        public void setToolbarMode​(boolean isToolbarMode)
        Sets the isToolbarMode.

        Parameters:
        isToolbarMode - the isToolbarMode to set
      • show

        public void show()
        Shows the menu content as well as the menu connector.

      • autoClose

        protected void autoClose()
        Called on auto close.

      • getPopup

        protected CmsPopup getPopup()
        Returns the popup content.

        Returns:
        the popup content
      • hideMenu

        protected void hideMenu()
        Hides the menu content without altering the button state.

      • isEnabled

        protected boolean isEnabled()
        Returns if this button is enabled.

        Returns:
        true if the button is enabled
      • setButtonDown

        protected void setButtonDown()
        Sets the button to its 'down state'.
      • setButtonUp

        protected void setButtonUp()
        Sets button to state up, hides menu fragments (not the content pop-up) and fires the toggle event.