Class ContextMenuItem
java.lang.Object
com.levigo.jadice.web.client.ui.menu.contextmenu.ContextMenuItem
- Direct Known Subclasses:
ContextMenuItemCommand,ContextMenuItemSubMenu
Abstract class for all a menu or context menu item.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ContextMenuHandlerprotected com.google.gwt.user.client.ui.IsWidget -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void_onKeyDown(com.google.gwt.event.dom.client.KeyDownEvent event) abstract booleanexecute(com.google.gwt.dom.client.Element rowElement) Overriden in subclasses.Returns the key stroke string.getLabel()Returns the label of the item.voidhide()voidinit(com.google.gwt.user.client.ui.IsWidget parentWidget, ContextMenuHandler handler) Initializes the menu item with a parent widget and aContextMenuHandler.abstract booleanReturns whether this item is a sub-menu or notvoidonAttach()Call on attach.voidonDetach()Call on detach.final voidonKeyDown(com.google.gwt.event.dom.client.KeyDownEvent event, boolean isLocal) Fired when a KeyEvent was firedprotected voidsetAvailable(boolean available) protected voidsetEnabled(boolean enabled) voidsetHover(boolean hover) Sets whether the icon is hovered or not.protected voidsetSelected(boolean selected)
-
Field Details
-
handler
-
parentWidget
protected com.google.gwt.user.client.ui.IsWidget parentWidget
-
-
Constructor Details
-
ContextMenuItem
Constructor.- Parameters:
action- theActionproviding the content for this context menu item
-
-
Method Details
-
getLabel
Returns the label of the item.- Returns:
- the label
-
getKeyStrokeString
Returns the key stroke string.- Returns:
- the string
-
setSelected
protected void setSelected(boolean selected) -
setEnabled
protected void setEnabled(boolean enabled) -
setAvailable
protected void setAvailable(boolean available) -
setHover
public void setHover(boolean hover) Sets whether the icon is hovered or not.- Parameters:
hover- true if the icon is hovered, false if not
-
onKeyDown
public final void onKeyDown(com.google.gwt.event.dom.client.KeyDownEvent event, boolean isLocal) Fired when a KeyEvent was fired- Parameters:
event- theKeyDownEventisLocal- true when mnemonic can fire
-
_onKeyDown
protected void _onKeyDown(com.google.gwt.event.dom.client.KeyDownEvent event) -
execute
public abstract boolean execute(com.google.gwt.dom.client.Element rowElement) Overriden in subclasses.- Parameters:
rowElement- An element that can be used to dynamically place the new context menu entry.- Returns:
- True if it was successfully executed (stop propagation, prevent default browser behavior).
-
onAttach
public void onAttach()Call on attach. Executes attach actions. -
onDetach
public void onDetach()Call on detach. Executes detach actions. -
hide
public void hide()
-