Class ContextMenuItem

All Implemented Interfaces:
IHandler, IHandler2

public class ContextMenuItem extends 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

  • 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 CommandContributionItem getCommandContributionItem()
      Gets the command contribution item.
    • createCommandContributionItem

      public CommandContributionItem createCommandContributionItem()
      Gets the command contribution item.
    • execute

      public Object execute(ExecutionEvent event) throws ExecutionException
      Performs the Handler operation.
      Throws:
      ExecutionException
    • createMenuItem

      public IzMenuItem createMenuItem(Viewer viewer, IzMenu menu, IPropUndoRedo undoRedo)
      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.