public class CmsMenuButton
extends com.google.gwt.user.client.ui.Composite
implements com.google.gwt.event.dom.client.HasClickHandlers
限定符和类型 | 字段和说明 |
---|---|
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.
|
构造器和说明 |
---|
CmsMenuButton(java.lang.String buttonText,
java.lang.String imageClass)
Constructor.
|
限定符和类型 | 方法和说明 |
---|---|
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.
|
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onDetach, render, render, resolvePotentialElement, setWidget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents
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, unsinkEvents
@UiField protected CmsPushButton m_button
protected CmsToolbarPopup m_popup
protected com.google.gwt.event.shared.HandlerRegistration m_resizeRegistration
@UiConstructor public CmsMenuButton(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
在接口中 com.google.gwt.event.dom.client.HasClickHandlers
HasClickHandlers.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 void onBrowserEvent(com.google.gwt.user.client.Event event)
onBrowserEvent
在接口中 com.google.gwt.user.client.EventListener
onBrowserEvent
在类中 com.google.gwt.user.client.ui.Composite
Composite.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 CmsPopup getPopup()
protected void hideMenu()
protected boolean isEnabled()
true
if the button is enabledprotected void setButtonDown()
protected void setButtonUp()