Class CmsContextMenuWidget
java.lang.Object
com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
org.opencms.ui.client.contextmenu.CmsContextMenuWidget
- All Implemented Interfaces:
com.google.gwt.event.logical.shared.HasAttachHandlers
,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.IsWidget
Client side implementation for ContextMenu component.
Adapted from ContextMenu by Peter Lehto / Vaadin Ltd.
-
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
-
Method Summary
Modifier and TypeMethodDescriptioncom.google.gwt.event.shared.HandlerRegistration
addCloseHandler
(com.google.gwt.event.logical.shared.CloseHandler<com.google.gwt.user.client.ui.PopupPanel> popupCloseHandler) Adds a menu popup close handler.void
addRootMenuItem
(org.opencms.ui.shared.CmsContextMenuState.ContextMenuItemState rootItem, CmsContextMenuConnector connector) Adds new item as context menu root item.void
Clears the menu items.protected boolean
eventTargetContextMenu
(com.google.gwt.user.client.Event nativeEvent) Returns whether the given event targets the context menu.com.google.gwt.user.client.ui.Widget
Returns the extension target widget.void
hide()
Hides the menu popup.boolean
Returns whether the menu is set to hide automatically.protected boolean
Returns whether the menu is showing.void
setExtensionTarget
(com.google.gwt.user.client.ui.Widget extensionTarget) Sets the extension target.void
setHideAutomatically
(boolean hideAutomatically) Sets the hide automatically flag.void
showContextMenu
(int rootMenuX, int rootMenuY) Shows the context menu at the given position.void
showContextMenu
(com.google.gwt.user.client.ui.Widget widget) Shows the context menu relative to the given widget.void
Unregisters the menu.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, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, 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, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
-
Constructor Details
-
CmsContextMenuWidget
public CmsContextMenuWidget()Constructor.
-
-
Method Details
-
clearItems
Clears the menu items. -
getExtensionTarget
Returns the extension target widget.- Returns:
- the extension target widget
-
hide
Hides the menu popup. -
isHideAutomatically
Returns whether the menu is set to hide automatically.- Returns:
true
if the menu is set to hide automatically
-
setExtensionTarget
Sets the extension target.- Parameters:
extensionTarget
- the etension target
-
setHideAutomatically
Sets the hide automatically flag.- Parameters:
hideAutomatically
- the hide automatically flag
-
showContextMenu
Shows the context menu at the given position.- Parameters:
rootMenuX
- the client x positionrootMenuY
- the client y position
-
showContextMenu
Shows the context menu relative to the given widget.- Parameters:
widget
- the widget
-
unregister
Unregisters the menu. -
eventTargetContextMenu
Returns whether the given event targets the context menu.- Parameters:
nativeEvent
- the event to check- Returns:
true
if the event targets the menu
-
isShowing
Returns whether the menu is showing.- Returns:
true
if the menu is showing