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.HandlerRegistrationaddClickHandler(com.google.gwt.event.dom.client.ClickHandler handler) com.google.gwt.event.shared.HandlerRegistrationaddMouseOutHandler(com.google.gwt.event.dom.client.MouseOutHandler handler) com.google.gwt.event.shared.HandlerRegistrationaddMouseOverHandler(com.google.gwt.event.dom.client.MouseOverHandler handler) voidDeselects 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.booleanReturnstrueif this menu item has a sub menu,falseotherwise.protected voidinitWidget(com.google.gwt.user.client.ui.Widget widget) booleanisActive()Returnstrueif the item is activefalseotherwise.abstract voidonClick(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 voidonHoverIn(com.google.gwt.event.dom.client.MouseOverEvent event) Implements the hover over action for a item.protected voidonHoverOut(com.google.gwt.event.dom.client.MouseOutEvent event) Implements the hover out action for a item.final voidonMouseOut(com.google.gwt.event.dom.client.MouseOutEvent event) final voidonMouseOver(com.google.gwt.event.dom.client.MouseOverEvent event) voidSelects a item.voidMakes the menu item active or inactive.protected voidsetParentMenu(CmsContextMenu parentMenu) Sets the parent menu of this menu item.protected voidsetSubMenu(CmsContextMenu subMenu) Sets the sub menu for the menu item.voidSets 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, 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
-
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:
addClickHandlerin interfacecom.google.gwt.event.dom.client.HasClickHandlers- See Also:
-
addMouseOutHandler
public com.google.gwt.event.shared.HandlerRegistration addMouseOutHandler(com.google.gwt.event.dom.client.MouseOutHandler handler) - Specified by:
addMouseOutHandlerin interfacecom.google.gwt.event.dom.client.HasMouseOutHandlers- See Also:
-
addMouseOverHandler
public com.google.gwt.event.shared.HandlerRegistration addMouseOverHandler(com.google.gwt.event.dom.client.MouseOverHandler handler) - Specified by:
addMouseOverHandlerin interfacecom.google.gwt.event.dom.client.HasMouseOverHandlers- See Also:
-
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
Returnstrueif the item is activefalseotherwise.- Returns:
trueif the item is activefalseotherwise
-
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:
onClickin interfacecom.google.gwt.event.dom.client.ClickHandler- See Also:
-
onMouseOut
- Specified by:
onMouseOutin interfacecom.google.gwt.event.dom.client.MouseOutHandler- See Also:
-
onMouseOver
- Specified by:
onMouseOverin interfacecom.google.gwt.event.dom.client.MouseOverHandler- See Also:
-
selectItem
Selects a item. -
setActive
Makes the menu item active or inactive.If the item is inactive all handlers are removed.
- Parameters:
active-trueif the item should be active,falseotherwisereason- the reason for de-activation
-
setText
Sets the text of the menu item.- Parameters:
text- the text to set
-
initWidget
- Overrides:
initWidgetin classcom.google.gwt.user.client.ui.Composite- See Also:
-
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
-