com.alkacon.geranium.client.ui
public class MenuButton extends com.google.gwt.user.client.ui.Composite implements com.google.gwt.event.dom.client.HasClickHandlers
| Modifier and Type | Field and Description |
|---|---|
protected PushButton |
m_button
The menu button.
|
protected ToolbarPopup |
m_popup
The menu content.
|
protected com.google.gwt.event.shared.HandlerRegistration |
m_resizeRegistration
Registration of the window resize handler.
|
| Constructor and Description |
|---|
MenuButton(java.lang.String buttonText,
java.lang.String imageClass)
Constructor.
|
| Modifier and Type | Method and 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 Popup |
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.
|
boolean |
isToolbarMode()
Returns the isToolbarMode.
|
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.
|
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onDetach, render, render, resolvePotentialElement, setWidgetaddAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEventsaddStyleDependentName, 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@UiField protected PushButton m_button
protected ToolbarPopup m_popup
protected com.google.gwt.event.shared.HandlerRegistration m_resizeRegistration
@UiConstructor
public MenuButton(java.lang.String buttonText,
java.lang.String imageClass)
buttonText - the menu button textimageClass - the menu button image sprite classpublic com.google.gwt.event.shared.HandlerRegistration addClickHandler(com.google.gwt.event.dom.client.ClickHandler handler)
addClickHandler in interface com.google.gwt.event.dom.client.HasClickHandlersHasClickHandlers.addClickHandler(com.google.gwt.event.dom.client.ClickHandler)public void clear()
public void closeMenu()
public void disable(java.lang.String disabledReason)
disabledReason - the reason to set in the button titlepublic void enable()
public void hide()
public boolean isOpen()
true if the menu is openedpublic boolean isOpenRight()
public boolean isToolbarMode()
public void onBrowserEvent(com.google.gwt.user.client.Event event)
onBrowserEvent in interface com.google.gwt.user.client.EventListeneronBrowserEvent in class com.google.gwt.user.client.ui.CompositeComposite.onBrowserEvent(com.google.gwt.user.client.Event)public void openMenu()
public void setEnabled(boolean enabled)
enabled - if true, enables the button, else disables itpublic void setMenuWidget(com.google.gwt.user.client.ui.Widget widget)
widget - the widget to set as contentpublic void setOpenRight(boolean isOpenRight)
isOpenRight - the isOpenRight to setpublic void setToolbarMode(boolean isToolbarMode)
isToolbarMode - the isToolbarMode to setpublic void show()
protected void autoClose()
protected Popup getPopup()
protected void hideMenu()
protected boolean isEnabled()
true if the button is enabledprotected void setButtonDown()
protected void setButtonUp()