Package com.iizigo.editor
Class ContextMenuItem
java.lang.Object
org.eclipse.core.commands.common.EventManager
org.eclipse.core.commands.AbstractHandler
com.iizigo.editor.ContextMenuItem
The Add Item class for a DesignerProp class. This class serves multiple purposes, i.e. to be the Command Contribution Item, the Command and the Handler for the Command, all in one.
- Author:
- Christopher Mindus
Field Summary
Constructor Summary
ConstructorDescriptionThe Eclipse constructor.ContextMenuItem
(String label, IContextMenuAction adder) Creates the Add Item instance for a DesignerProp class.ContextMenuItem
(String label, String mnemonic, int accelerator, ImageDescriptor icon, IContextMenuAction adder) Creates the Add Item instance for a DesignerProp class.ContextMenuItem
(String label, String mnemonic, IContextMenuAction adder) Creates the Add Item instance for a DesignerProp class.ContextMenuItem
(String label, String mnemonic, ImageDescriptor icon, IContextMenuAction adder) Creates the Add Item instance for a DesignerProp class.ContextMenuItem
(String label, ImageDescriptor icon, IContextMenuAction adder) Creates the Add Item instance for a DesignerProp class.Method Summary
Modifier and TypeMethodDescriptionGets the command contribution item.createMenuItem
(DesignerProp target, Control control, IzMenu menu, IPropUndoRedo undoRedo) Creates a menu item for this Add-Item.createMenuItem
(Viewer viewer, IzMenu menu, IPropUndoRedo undoRedo) Creates a menu item for this Add-Item.boolean
Checks if this item requires a separator before.execute
(ExecutionEvent event) Performs the Handler operation.Gets the command contribution item.boolean
isEnabled
(DesignerProp target) Checks if the Add Item is enabled in order not to add it in a pop-up menu if disabled.void
Adds a separator before this item.Methods inherited from class org.eclipse.core.commands.AbstractHandler
addHandlerListener, dispose, fireHandlerChanged, hasListeners, isEnabled, isHandled, removeHandlerListener, setBaseEnabled, setEnabled
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
Field Details
HANDLER_ID
This Handler ID.accelerator
public final int acceleratorThe accelerator.
Constructor Details
ContextMenuItem
public ContextMenuItem()The Eclipse constructor.ContextMenuItem
Creates the Add Item instance for a DesignerProp class.ContextMenuItem
Creates the Add Item instance for a DesignerProp class.ContextMenuItem
Creates the Add Item instance for a DesignerProp class.ContextMenuItem
public ContextMenuItem(String label, String mnemonic, ImageDescriptor icon, IContextMenuAction adder) Creates the Add Item instance for a DesignerProp class.ContextMenuItem
public ContextMenuItem(String label, String mnemonic, int accelerator, ImageDescriptor icon, IContextMenuAction adder) Creates the Add Item instance for a DesignerProp class.
Method Details
setSeparatorBefore
public void setSeparatorBefore()Adds a separator before this item.doAddSeparator
public boolean doAddSeparator()Checks if this item requires a separator before.isEnabled
Checks if the Add Item is enabled in order not to add it in a pop-up menu if disabled.getCommandContributionItem
Gets the command contribution item.createCommandContributionItem
Gets the command contribution item.execute
Performs the Handler operation.- Throws:
ExecutionException
createMenuItem
Creates a menu item for this Add-Item.createMenuItem
public IzMenuItem createMenuItem(DesignerProp target, Control control, IzMenu menu, IPropUndoRedo undoRedo) Creates a menu item for this Add-Item.