Class ContextMenuItemCommand
java.lang.Object
com.levigo.jadice.web.client.ui.menu.contextmenu.ContextMenuItem
com.levigo.jadice.web.client.ui.menu.contextmenu.ContextMenuItemCommand
A menu or context menu item which executes the contained command when clicking on the item.
-
Field Summary
Fields inherited from class com.levigo.jadice.web.client.ui.menu.contextmenu.ContextMenuItem
handler, parentWidget
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
execute
(com.google.gwt.dom.client.Element rowElement) Overriden in subclasses.boolean
Returns whether this item is a sub-menu or notvoid
onAttach()
Call on attach.void
onDetach()
Call on detach.void
setContext
(Collection<Object> context) Sets the context to this itemprotected void
update()
Methods inherited from class com.levigo.jadice.web.client.ui.menu.contextmenu.ContextMenuItem
_onKeyDown, getKeyStrokeString, getLabel, hide, init, onKeyDown, setAvailable, setEnabled, setHover, setSelected
-
Constructor Details
-
ContextMenuItemCommand
Creates a new menu item.- Parameters:
action
- the action for this context menu item
-
-
Method Details
-
setContext
Sets the context to this item- Parameters:
context
- the context
-
execute
public boolean execute(com.google.gwt.dom.client.Element rowElement) Description copied from class:ContextMenuItem
Overriden in subclasses.- Specified by:
execute
in classContextMenuItem
- 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()Description copied from class:ContextMenuItem
Call on attach. Executes attach actions.- Overrides:
onAttach
in classContextMenuItem
-
onDetach
public void onDetach()Description copied from class:ContextMenuItem
Call on detach. Executes detach actions.- Overrides:
onDetach
in classContextMenuItem
-
update
protected void update()
-