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
FieldsFields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSubMenuItem(CmsContextMenuItemWidget contextMenuItem) Adds given context menu item into the sub menu of this item.voidRemoves all the items from the submenu of this item.voidCloses the sibling menu.protected voidCloses this item and selects the parent.booleaneventTargetsPopup(com.google.gwt.user.client.Event nativeEvent) Checks whether the given event targets the menu popup.getId()Returns the id.Returns the parent item.booleanReturns if the item has a sub menu.voidHides the sub menu that's been opened from this item.booleanReturns whether this is the root item.booleanReturns if the sub menu is open.protected booleanCalled when context menu item is clicked or is focused and enter is pressed.protected voidSelects the next sibling.protected voidSelects the previous sibling.voidsetCaption(String caption) Sets the caption.voidsetEnabled(boolean enabled) voidsetFocus(boolean focused) voidsetIcon(com.vaadin.client.ui.Icon icon) Sets the icon.voidSets the id.voidsetOverlay(org.opencms.ui.client.contextmenu.CmsContextMenuOverlay owner) Sets the menu component to which this item belongs to.voidsetParentItem(CmsContextMenuItemWidget parentItem) Sets parent item meaning that this item is in the sub menu of given parent item.voidsetRootComponent(CmsContextMenuWidget rootComponent) Sets the root component.voidsetSeparatorVisible(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, setTabIndexMethods 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, 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, resolvePotentialElement, 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
-
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:
trueif 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:
trueif 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:
trueif this item is an item in the root menu
-
setCaption
Sets the caption.- Parameters:
caption- the caption to set
-
setEnabled
- Specified by:
setEnabledin interfacecom.google.gwt.user.client.ui.HasEnabled- Overrides:
setEnabledin classcom.google.gwt.user.client.ui.FocusWidget- See Also:
-
setFocus
- Specified by:
setFocusin interfacecom.google.gwt.user.client.ui.Focusable- Overrides:
setFocusin classcom.google.gwt.user.client.ui.FocusWidget- See Also:
-
setIcon
Sets the icon.- Parameters:
icon- the icon
-
setId
Sets the id.- Parameters:
id- the id
-
setSeparatorVisible
Sets the separator visibility.- Parameters:
separatorVisible-trueto 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:
trueif context menu was closed after the click
-
selectLowerSibling
Selects the next sibling. -
selectUpperSibling
Selects the previous sibling.