Class CmsContextMenuItemWidget
java.lang.Object
com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.FocusWidget
org.opencms.ui.client.contextmenu.CmsContextMenuItemWidget
- All Implemented Interfaces:
com.google.gwt.event.dom.client.HasAllDragAndDropHandlers
,com.google.gwt.event.dom.client.HasAllFocusHandlers
,com.google.gwt.event.dom.client.HasAllGestureHandlers
,com.google.gwt.event.dom.client.HasAllKeyHandlers
,com.google.gwt.event.dom.client.HasAllMouseHandlers
,com.google.gwt.event.dom.client.HasAllTouchHandlers
,com.google.gwt.event.dom.client.HasBlurHandlers
,com.google.gwt.event.dom.client.HasClickHandlers
,com.google.gwt.event.dom.client.HasDoubleClickHandlers
,com.google.gwt.event.dom.client.HasDragEndHandlers
,com.google.gwt.event.dom.client.HasDragEnterHandlers
,com.google.gwt.event.dom.client.HasDragHandlers
,com.google.gwt.event.dom.client.HasDragLeaveHandlers
,com.google.gwt.event.dom.client.HasDragOverHandlers
,com.google.gwt.event.dom.client.HasDragStartHandlers
,com.google.gwt.event.dom.client.HasDropHandlers
,com.google.gwt.event.dom.client.HasFocusHandlers
,com.google.gwt.event.dom.client.HasGestureChangeHandlers
,com.google.gwt.event.dom.client.HasGestureEndHandlers
,com.google.gwt.event.dom.client.HasGestureStartHandlers
,com.google.gwt.event.dom.client.HasKeyDownHandlers
,com.google.gwt.event.dom.client.HasKeyPressHandlers
,com.google.gwt.event.dom.client.HasKeyUpHandlers
,com.google.gwt.event.dom.client.HasMouseDownHandlers
,com.google.gwt.event.dom.client.HasMouseMoveHandlers
,com.google.gwt.event.dom.client.HasMouseOutHandlers
,com.google.gwt.event.dom.client.HasMouseOverHandlers
,com.google.gwt.event.dom.client.HasMouseUpHandlers
,com.google.gwt.event.dom.client.HasMouseWheelHandlers
,com.google.gwt.event.dom.client.HasTouchCancelHandlers
,com.google.gwt.event.dom.client.HasTouchEndHandlers
,com.google.gwt.event.dom.client.HasTouchMoveHandlers
,com.google.gwt.event.dom.client.HasTouchStartHandlers
,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.Focusable
,com.google.gwt.user.client.ui.HasEnabled
,com.google.gwt.user.client.ui.HasFocus
,com.google.gwt.user.client.ui.HasVisibility
,com.google.gwt.user.client.ui.IsWidget
,com.google.gwt.user.client.ui.SourcesClickEvents
,com.google.gwt.user.client.ui.SourcesFocusEvents
,com.google.gwt.user.client.ui.SourcesKeyboardEvents
,com.google.gwt.user.client.ui.SourcesMouseEvents
ContextMenuItemWidget is client side widget that represents one menu item in
context menu.
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 TypeMethodDescriptionvoid
addSubMenuItem
(CmsContextMenuItemWidget contextMenuItem) Adds given context menu item into the sub menu of this item.void
Removes all the items from the submenu of this item.void
Closes the sibling menu.protected void
Closes this item and selects the parent.boolean
eventTargetsPopup
(com.google.gwt.user.client.Event nativeEvent) Checks whether the given event targets the menu popup.getId()
Returns the id.Returns the parent item.boolean
Returns if the item has a sub menu.void
Hides the sub menu that's been opened from this item.boolean
Returns whether this is the root item.boolean
Returns if the sub menu is open.protected boolean
Called when context menu item is clicked or is focused and enter is pressed.protected void
Selects the next sibling.protected void
Selects the previous sibling.void
setCaption
(String caption) Sets the caption.void
setEnabled
(boolean enabled) void
setFocus
(boolean focused) void
setIcon
(com.vaadin.client.ui.Icon icon) Sets the icon.void
Sets the id.void
setOverlay
(org.opencms.ui.client.contextmenu.CmsContextMenuOverlay owner) Sets the menu component to which this item belongs to.void
setParentItem
(CmsContextMenuItemWidget parentItem) Sets parent item meaning that this item is in the sub menu of given parent item.void
setRootComponent
(CmsContextMenuWidget rootComponent) Sets the root component.void
setSeparatorVisible
(boolean separatorVisible) Sets the separator visibility.Methods inherited from class com.google.gwt.user.client.ui.FocusWidget
addBlurHandler, addClickHandler, addClickListener, addDoubleClickHandler, addDragEndHandler, addDragEnterHandler, addDragHandler, addDragLeaveHandler, addDragOverHandler, addDragStartHandler, addDropHandler, addFocusHandler, addFocusListener, addGestureChangeHandler, addGestureEndHandler, addGestureStartHandler, addKeyboardListener, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, addMouseDownHandler, addMouseListener, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseUpHandler, addMouseWheelHandler, addMouseWheelListener, addTouchCancelHandler, addTouchEndHandler, addTouchMoveHandler, addTouchStartHandler, getFocusImpl, getTabIndex, isEnabled, onAttach, removeClickListener, removeFocusListener, removeKeyboardListener, removeMouseListener, removeMouseWheelListener, setAccessKey, setTabIndex
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, 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
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
-
Field Details
-
m_icon
The icon.
-
-
Constructor Details
-
CmsContextMenuItemWidget
public CmsContextMenuItemWidget()Constructor.
-
-
Method Details
-
clearItems
Removes all the items from the submenu of this item. If this menu item does not have a sub menu, this call has no effect. -
closeSiblingMenus
Closes the sibling menu. -
eventTargetsPopup
Checks whether the given event targets the menu popup.- Parameters:
nativeEvent
- the event to check- Returns:
true
if given event targets the overlay of this menu item or overlay of any of this item's child item.
-
getId
Returns the id.- Returns:
- the id
-
getParentItem
Returns the parent item.- Returns:
- menu item that opened the menu to which this item belongs
-
hasSubMenu
Returns if the item has a sub menu.- Returns:
true
if this item has a sub menu
-
hideSubMenu
Hides the sub menu that's been opened from this item. -
isRootItem
Returns whether this is the root item.- Returns:
true
if this item is an item in the root menu
-
setCaption
Sets the caption.- Parameters:
caption
- the caption to set
-
setEnabled
- Specified by:
setEnabled
in interfacecom.google.gwt.user.client.ui.HasEnabled
- Overrides:
setEnabled
in classcom.google.gwt.user.client.ui.FocusWidget
- See Also:
-
FocusWidget.setEnabled(boolean)
-
setFocus
- Specified by:
setFocus
in interfacecom.google.gwt.user.client.ui.Focusable
- Overrides:
setFocus
in classcom.google.gwt.user.client.ui.FocusWidget
- See Also:
-
FocusWidget.setFocus(boolean)
-
setIcon
Sets the icon.- Parameters:
icon
- the icon
-
setId
Sets the id.- Parameters:
id
- the id
-
setSeparatorVisible
Sets the separator visibility.- Parameters:
separatorVisible
-true
to set the separator visible
-
closeThisAndSelectParent
Closes this item and selects the parent. -
onItemClicked
Called when context menu item is clicked or is focused and enter is pressed.- Returns:
true
if context menu was closed after the click
-
selectLowerSibling
Selects the next sibling. -
selectUpperSibling
Selects the previous sibling.