Package com.iizigo.editor
Class ContextMenuItem
java.lang.Object
org.eclipse.core.commands.common.EventManager
org.eclipse.core.commands.AbstractHandler
com.iizigo.editor.ContextMenuItem
- All Implemented Interfaces:
org.eclipse.core.commands.IHandler
,org.eclipse.core.commands.IHandler2
public class ContextMenuItem extends org.eclipse.core.commands.AbstractHandler
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, org.eclipse.jface.resource.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, org.eclipse.jface.resource.ImageDescriptor icon, IContextMenuAction adder) Creates the Add Item instance for a DesignerProp class.ContextMenuItem
(String label, org.eclipse.jface.resource.ImageDescriptor icon, IContextMenuAction adder) Creates the Add Item instance for a DesignerProp class.Method Summary
Modifier and TypeMethodDescriptionorg.eclipse.ui.menus.CommandContributionItem
Gets the command contribution item.createMenuItem
(DesignerProp target, org.eclipse.swt.widgets.Control control, IzMenu menu, IPropUndoRedo undoRedo) Creates a menu item for this Add-Item.createMenuItem
(org.eclipse.jface.viewers.Viewer viewer, IzMenu menu, IPropUndoRedo undoRedo) Creates a menu item for this Add-Item.boolean
Checks if this item requires a separator before.execute
(org.eclipse.core.commands.ExecutionEvent event) Performs the Handler operation.org.eclipse.ui.menus.CommandContributionItem
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
public ContextMenuItem(String label, org.eclipse.jface.resource.ImageDescriptor icon, IContextMenuAction adder) 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, org.eclipse.jface.resource.ImageDescriptor icon, IContextMenuAction adder) Creates the Add Item instance for a DesignerProp class.ContextMenuItem
public ContextMenuItem(String label, String mnemonic, int accelerator, org.eclipse.jface.resource.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
public org.eclipse.ui.menus.CommandContributionItem getCommandContributionItem()Gets the command contribution item.createCommandContributionItem
public org.eclipse.ui.menus.CommandContributionItem createCommandContributionItem()Gets the command contribution item.execute
public Object execute(org.eclipse.core.commands.ExecutionEvent event) throws org.eclipse.core.commands.ExecutionException Performs the Handler operation.- Throws:
org.eclipse.core.commands.ExecutionException
createMenuItem
public IzMenuItem createMenuItem(org.eclipse.jface.viewers.Viewer viewer, IzMenu menu, IPropUndoRedo undoRedo) Creates a menu item for this Add-Item.createMenuItem
public IzMenuItem createMenuItem(DesignerProp target, org.eclipse.swt.widgets.Control control, IzMenu menu, IPropUndoRedo undoRedo) Creates a menu item for this Add-Item.