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
FieldsModifier and TypeFieldDescriptionprotected CmsPushButtonThe menu button.protected CmsToolbarPopupThe menu content.protected com.google.gwt.event.shared.HandlerRegistrationRegistration of the window resize handler.Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor.CmsMenuButton(String buttonText, String imageClass) Constructor. -
Method Summary
Modifier and TypeMethodDescriptioncom.google.gwt.event.shared.HandlerRegistrationaddClickHandler(com.google.gwt.event.dom.client.ClickHandler handler) protected voidCalled on auto close.voidclear()Removes all content from menu.voidCloses the menu and fires the on toggle event.voidDisables the menu button.voidenable()Enables or disables the button.protected CmsPopupgetPopup()Returns the popup content.voidhide()Hides the menu content as well as the menu connector.protected voidhideMenu()Hides the menu content without altering the button state.protected booleanReturns if this button is enabled.booleanisOpen()Returns if the menu is open.booleanReturns the isOpenRight.voidonBrowserEvent(com.google.gwt.user.client.Event event) voidopenMenu()Opens the menu and fires the on toggle event.protected voidSets the button to its 'down state'.protected voidSets button to state up, hides menu fragments (not the content pop-up) and fires the toggle event.voidsetEnabled(boolean enabled) Enables or disables the button.voidsetMenuWidget(com.google.gwt.user.client.ui.Widget widget) This will set the menu content widget.voidsetOpenRight(boolean isOpenRight) Sets the isOpenRight.voidsetToolbarMode(boolean isToolbarMode) Sets the isToolbarMode.voidshow()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, setWidgetMethods 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, unsinkEventsMethods 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, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:
addClickHandlerin interfacecom.google.gwt.event.dom.client.HasClickHandlers- See Also:
-
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:
trueif the menu is opened
-
isOpenRight
Returns the isOpenRight.- Returns:
- the isOpenRight
-
onBrowserEvent
- Specified by:
onBrowserEventin interfacecom.google.gwt.user.client.EventListener- Overrides:
onBrowserEventin classcom.google.gwt.user.client.ui.Composite- See Also:
-
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:
trueif 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.
-