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 Details

    • HANDLER_ID

      public static final String HANDLER_ID
      This Handler ID.
    • accelerator

      public final int accelerator
      The accelerator.
  • Constructor Details

    • ContextMenuItem

      public ContextMenuItem()
      The Eclipse constructor.
    • ContextMenuItem

      public ContextMenuItem(String label, IContextMenuAction adder)
      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

      public ContextMenuItem(String label, String mnemonic, IContextMenuAction adder)
      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

      public boolean isEnabled(DesignerProp target)
      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.