Package org.opencms.gwt.client.ui
Class CmsMenuButton
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.CmsMenuButton
- All Implemented Interfaces:
com.google.gwt.event.dom.client.HasClickHandlers
,com.google.gwt.event.logical.shared.HasAttachHandlers
,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
- Direct Known Subclasses:
A_CmsToolbarListMenuButton
,A_CmsToolbarMenu
,CmsContextMenuButton
,CmsHoverbarContextMenuButton
,CmsQuickLauncher
,CmsToolbarChooseEditorModeButton
public class CmsMenuButton
extends com.google.gwt.user.client.ui.Composite
implements com.google.gwt.event.dom.client.HasClickHandlers
Provides a menu button.
- 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
-
Field Summary
Modifier and TypeFieldDescriptionprotected CmsPushButton
The menu button.protected CmsToolbarPopup
The menu content.protected com.google.gwt.event.shared.HandlerRegistration
Registration of the window resize handler.Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
-
Constructor Summary
ModifierConstructorDescriptionprotected
Constructor.CmsMenuButton
(String buttonText, String imageClass) Constructor. -
Method Summary
Modifier and TypeMethodDescriptioncom.google.gwt.event.shared.HandlerRegistration
addClickHandler
(com.google.gwt.event.dom.client.ClickHandler handler) protected void
Called on auto close.void
clear()
Removes all content from menu.void
Closes the menu and fires the on toggle event.void
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
Returns if this button is enabled.boolean
isOpen()
Returns if the menu is open.boolean
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
Sets the button to its 'down state'.protected void
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
-
Field Details
-
m_button
The menu button. -
m_popup
The menu content. -
m_resizeRegistration
Registration of the window resize handler.
-
-
Constructor Details
-
CmsMenuButton
Constructor.- Parameters:
buttonText
- the menu button textimageClass
- the menu button image sprite class
-
CmsMenuButton
protected CmsMenuButton()Constructor.
-
-
Method Details
-
addClickHandler
public com.google.gwt.event.shared.HandlerRegistration addClickHandler(com.google.gwt.event.dom.client.ClickHandler handler) - Specified by:
addClickHandler
in interfacecom.google.gwt.event.dom.client.HasClickHandlers
- See Also:
-
HasClickHandlers.addClickHandler(com.google.gwt.event.dom.client.ClickHandler)
-
clear
Removes all content from menu. -
closeMenu
Closes the menu and fires the on toggle event. -
disable
Disables the menu button.- Parameters:
disabledReason
- the reason to set in the button title
-
enable
Enables or disables the button. -
hide
Hides the menu content as well as the menu connector. -
isOpen
Returns if the menu is open.- Returns:
true
if the menu is opened
-
isOpenRight
Returns the isOpenRight.- Returns:
- the isOpenRight
-
onBrowserEvent
- Specified by:
onBrowserEvent
in interfacecom.google.gwt.user.client.EventListener
- Overrides:
onBrowserEvent
in classcom.google.gwt.user.client.ui.Composite
- See Also:
-
Composite.onBrowserEvent(com.google.gwt.user.client.Event)
-
openMenu
Opens the menu and fires the on toggle event. -
setEnabled
Enables or disables the button.- Parameters:
enabled
- if true, enables the button, else disables it
-
setMenuWidget
This will set the menu content widget.- Parameters:
widget
- the widget to set as content
-
setOpenRight
Sets the isOpenRight.- Parameters:
isOpenRight
- the isOpenRight to set
-
setToolbarMode
Sets the isToolbarMode.- Parameters:
isToolbarMode
- the isToolbarMode to set
-
show
Shows the menu content as well as the menu connector. -
autoClose
Called on auto close. -
getPopup
Returns the popup content.- Returns:
- the popup content
-
hideMenu
Hides the menu content without altering the button state. -
isEnabled
Returns if this button is enabled.- Returns:
true
if the button is enabled
-
setButtonDown
Sets the button to its 'down state'. -
setButtonUp
Sets button to state up, hides menu fragments (not the content pop-up) and fires the toggle event.
-