Class A_CmsContextMenuItem
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.contextmenu.A_CmsContextMenuItem
- All Implemented Interfaces:
com.google.gwt.event.dom.client.ClickHandler
,com.google.gwt.event.dom.client.HasClickHandlers
,com.google.gwt.event.dom.client.HasMouseOutHandlers
,com.google.gwt.event.dom.client.HasMouseOverHandlers
,com.google.gwt.event.dom.client.MouseOutHandler
,com.google.gwt.event.dom.client.MouseOverHandler
,com.google.gwt.event.logical.shared.HasAttachHandlers
,com.google.gwt.event.shared.EventHandler
,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:
CmsContextMenuItem
,CmsReplace
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
A abstract implementation for a context menu item.
- Since:
- version 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
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.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
Deselects an item.Returns the parent menu of this menu item.Returns the sub menu of this menu item.getText()
Returns the text of this menu item.boolean
Returnstrue
if this menu item has a sub menu,false
otherwise.protected void
initWidget
(com.google.gwt.user.client.ui.Widget widget) boolean
isActive()
Returnstrue
if the item is activefalse
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.final void
onMouseOut
(com.google.gwt.event.dom.client.MouseOutEvent event) final void
onMouseOver
(com.google.gwt.event.dom.client.MouseOverEvent event) void
Selects a item.void
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
Sets the text of the menu item.Methods inherited from class com.google.gwt.user.client.ui.Composite
claimElement, getWidget, initializeClaimedElement, isAttached, onAttach, onBrowserEvent, 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
-
Constructor Details
-
A_CmsContextMenuItem
Constructor.- Parameters:
text
- the text for the menu item
-
-
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)
-
addMouseOutHandler
public com.google.gwt.event.shared.HandlerRegistration addMouseOutHandler(com.google.gwt.event.dom.client.MouseOutHandler handler) - Specified by:
addMouseOutHandler
in interfacecom.google.gwt.event.dom.client.HasMouseOutHandlers
- See Also:
-
HasMouseOutHandlers.addMouseOutHandler(com.google.gwt.event.dom.client.MouseOutHandler)
-
addMouseOverHandler
public com.google.gwt.event.shared.HandlerRegistration addMouseOverHandler(com.google.gwt.event.dom.client.MouseOverHandler handler) - Specified by:
addMouseOverHandler
in interfacecom.google.gwt.event.dom.client.HasMouseOverHandlers
- See Also:
-
HasMouseOverHandlers.addMouseOverHandler(com.google.gwt.event.dom.client.MouseOverHandler)
-
deselectItem
Deselects an item. -
getParentMenu
Returns the parent menu of this menu item.- Returns:
- the parent menu
-
getSubMenu
Returns the sub menu of this menu item.- Returns:
- the sub menu
-
getText
Returns the text of this menu item.- Returns:
- the text
-
isActive
Returnstrue
if the item is activefalse
otherwise.- Returns:
true
if the item is activefalse
otherwise
-
onClick
The action that is executed on click depends on the concrete implementation of a menu item. So the onClick Method has to be implemented in the sub class.- Specified by:
onClick
in interfacecom.google.gwt.event.dom.client.ClickHandler
- See Also:
-
ClickHandler.onClick(com.google.gwt.event.dom.client.ClickEvent)
-
onMouseOut
- Specified by:
onMouseOut
in interfacecom.google.gwt.event.dom.client.MouseOutHandler
- See Also:
-
MouseOutHandler.onMouseOut(com.google.gwt.event.dom.client.MouseOutEvent)
-
onMouseOver
- Specified by:
onMouseOver
in interfacecom.google.gwt.event.dom.client.MouseOverHandler
- See Also:
-
MouseOverHandler.onMouseOver(com.google.gwt.event.dom.client.MouseOverEvent)
-
selectItem
Selects a item. -
setActive
Makes the menu item active or inactive.If the item is inactive all handlers are removed.
- Parameters:
active
-true
if the item should be active,false
otherwisereason
- the reason for de-activation
-
setText
Sets the text of the menu item.- Parameters:
text
- the text to set
-
initWidget
- Overrides:
initWidget
in classcom.google.gwt.user.client.ui.Composite
- See Also:
-
Composite.initWidget(com.google.gwt.user.client.ui.Widget)
-
onHoverIn
Implements the hover over action for a item.First closes all sub menus that are not required anymore. And then reopens the necessary sub menus and activates the selected item.
- Parameters:
event
- the mouse over event
-
onHoverOut
Implements the hover out action for a item.If a menu item has no sub menu it will be deselected.
- Parameters:
event
- the mouse out event
-