public abstract class A_CmsContextMenuItem
extends com.google.gwt.user.client.ui.Composite
implements com.google.gwt.event.dom.client.ClickHandler, com.google.gwt.event.dom.client.MouseOutHandler, com.google.gwt.event.dom.client.MouseOverHandler, com.google.gwt.event.dom.client.HasClickHandlers, com.google.gwt.event.dom.client.HasMouseOutHandlers, com.google.gwt.event.dom.client.HasMouseOverHandlers
限定符 | 构造器和说明 |
---|---|
protected |
A_CmsContextMenuItem(java.lang.String text)
Constructor.
|
限定符和类型 | 方法和说明 |
---|---|
com.google.gwt.event.shared.HandlerRegistration |
addClickHandler(com.google.gwt.event.dom.client.ClickHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addMouseOutHandler(com.google.gwt.event.dom.client.MouseOutHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addMouseOverHandler(com.google.gwt.event.dom.client.MouseOverHandler handler) |
void |
deselectItem()
Deselects an item.
|
CmsContextMenu |
getParentMenu()
Returns the parent menu of this menu item.
|
CmsContextMenu |
getSubMenu()
Returns the sub menu of this menu item.
|
java.lang.String |
getText()
Returns the text of this menu item.
|
boolean |
hasSubmenu()
Returns
true if this menu item has a sub menu, false otherwise. |
protected void |
initWidget(com.google.gwt.user.client.ui.Widget widget) |
boolean |
isActive()
Returns
true if the item is active false otherwise. |
abstract void |
onClick(com.google.gwt.event.dom.client.ClickEvent event)
The action that is executed on click depends on the concrete implementation of a menu item.
|
protected void |
onHoverIn(com.google.gwt.event.dom.client.MouseOverEvent event)
Implements the hover over action for a item.
|
protected void |
onHoverOut(com.google.gwt.event.dom.client.MouseOutEvent event)
Implements the hover out action for a item.
|
void |
onMouseOut(com.google.gwt.event.dom.client.MouseOutEvent event) |
void |
onMouseOver(com.google.gwt.event.dom.client.MouseOverEvent event) |
void |
selectItem()
Selects a item.
|
void |
setActive(boolean active,
java.lang.String reason)
Makes the menu item active or inactive.
|
protected void |
setParentMenu(CmsContextMenu parentMenu)
Sets the parent menu of this menu item.
|
protected void |
setSubMenu(CmsContextMenu subMenu)
Sets the sub menu for the menu item.
|
void |
setText(java.lang.String text)
Sets the text of the menu item.
|
claimElement, getWidget, initializeClaimedElement, isAttached, onAttach, onBrowserEvent, 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
protected A_CmsContextMenuItem(java.lang.String text)
text
- the text for the menu itempublic 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 com.google.gwt.event.shared.HandlerRegistration addMouseOutHandler(com.google.gwt.event.dom.client.MouseOutHandler handler)
addMouseOutHandler
在接口中 com.google.gwt.event.dom.client.HasMouseOutHandlers
HasMouseOutHandlers.addMouseOutHandler(com.google.gwt.event.dom.client.MouseOutHandler)
public com.google.gwt.event.shared.HandlerRegistration addMouseOverHandler(com.google.gwt.event.dom.client.MouseOverHandler handler)
addMouseOverHandler
在接口中 com.google.gwt.event.dom.client.HasMouseOverHandlers
HasMouseOverHandlers.addMouseOverHandler(com.google.gwt.event.dom.client.MouseOverHandler)
public void deselectItem()
public CmsContextMenu getParentMenu()
public CmsContextMenu getSubMenu()
public java.lang.String getText()
public boolean hasSubmenu()
true
if this menu item has a sub menu, false
otherwise.true
if this menu item has a sub menupublic boolean isActive()
true
if the item is active false
otherwise.true
if the item is active false
otherwisepublic abstract void onClick(com.google.gwt.event.dom.client.ClickEvent event)
onClick
在接口中 com.google.gwt.event.dom.client.ClickHandler
ClickHandler.onClick(com.google.gwt.event.dom.client.ClickEvent)
public final void onMouseOut(com.google.gwt.event.dom.client.MouseOutEvent event)
onMouseOut
在接口中 com.google.gwt.event.dom.client.MouseOutHandler
MouseOutHandler.onMouseOut(com.google.gwt.event.dom.client.MouseOutEvent)
public final void onMouseOver(com.google.gwt.event.dom.client.MouseOverEvent event)
onMouseOver
在接口中 com.google.gwt.event.dom.client.MouseOverHandler
MouseOverHandler.onMouseOver(com.google.gwt.event.dom.client.MouseOverEvent)
public void selectItem()
public void setActive(boolean active, java.lang.String reason)
If the item is inactive all handlers are removed.
active
- true
if the item should be active, false
otherwisereason
- the reason for de-activationpublic void setText(java.lang.String text)
text
- the text to setprotected void initWidget(com.google.gwt.user.client.ui.Widget widget)
initWidget
在类中 com.google.gwt.user.client.ui.Composite
Composite.initWidget(com.google.gwt.user.client.ui.Widget)
protected void onHoverIn(com.google.gwt.event.dom.client.MouseOverEvent event)
First closes all sub menus that are not required anymore. And then reopens the necessary sub menus and activates the selected item.
event
- the mouse over eventprotected void onHoverOut(com.google.gwt.event.dom.client.MouseOutEvent event)
If a menu item has no sub menu it will be deselected.
event
- the mouse out eventprotected void setParentMenu(CmsContextMenu parentMenu)
parentMenu
- the parent menu to setprotected void setSubMenu(CmsContextMenu subMenu)
subMenu
- the sub menu to set