Class NewWizardMenu

All Implemented Interfaces:
IContributionItem

public class NewWizardMenu extends BaseNewWizardMenu
A NewWizardMenu augments BaseNewWizardMenu with IDE-specific actions: New Project... (always shown) and New Example... (shown only if there are example wizards installed).

Note: Clients must dispose this menu when it is no longer required.

  • Constructor Details

    • NewWizardMenu

      public NewWizardMenu(IWorkbenchWindow window)
      Creates a new wizard shortcut menu for the IDE.

      Note: Clients must dispose this menu when it is no longer required.

      Parameters:
      window - the window containing the menu
    • NewWizardMenu

      public NewWizardMenu(IWorkbenchWindow window, String id)
      Creates a new wizard shortcut menu for the IDE.

      Note: Clients must dispose this menu when it is no longer required.

      Parameters:
      window - the window containing the menu
      id - the identifier for this contribution item
    • NewWizardMenu

      @Deprecated public NewWizardMenu(IMenuManager innerMgr, IWorkbenchWindow window, boolean register)
      Deprecated.
      use NewWizardMenu(IWorkbenchWindow) instead
      Create a new wizard shortcut menu.

      If the menu will appear on a semi-permanent basis, for instance within a toolbar or menubar, the value passed for register should be true. If set, the menu will listen to perspective activation and update itself to suit. In this case clients are expected to call deregister when the menu is no longer needed. This will unhook any perspective listeners.

      Note: Clients must dispose this menu when it is no longer required.

      Parameters:
      innerMgr - the location for the shortcut menu contents
      window - the window containing the menu
      register - if true the menu listens to perspective changes in the window
  • Method Details

    • deregisterListeners

      @Deprecated public void deregisterListeners()
      Deprecated.
      has no effect
      Removes all listeners from the containing workbench window.

      This method should only be called if the shortcut menu is created with register = true.

    • addItems

      protected void addItems(List<IContributionItem> list)
      Description copied from class: BaseNewWizardMenu
      Adds the contribution items to show to the given list.
      Overrides:
      addItems in class BaseNewWizardMenu
      Parameters:
      list - the list to add contribution items to
    • isEnabled

      public boolean isEnabled()
      Description copied from class: ContributionItem
      The default implementation of this IContributionItem method returns true. Subclasses may override.
      Specified by:
      isEnabled in interface IContributionItem
      Overrides:
      isEnabled in class ContributionItem
      Returns:
      true if this item is enabled
    • setEnabled

      public void setEnabled(boolean enabledValue)
      Sets the enabled state of the receiver.
      Parameters:
      enabledValue - if true the menu is enabled; else it is disabled
    • getContributionItems

      protected IContributionItem[] getContributionItems()
      Description copied from class: CompoundContributionItem
      Return a list of contributions items that will replace this item in the parent manager. The list must contain new contribution items every call since the old ones will be disposed.
      Overrides:
      getContributionItems in class BaseNewWizardMenu
      Returns:
      an array list of items to display. Must not be null.
    • dispose

      public void dispose()
      Description copied from class: ContributionItem
      The default implementation of this IContributionItem method does nothing. Subclasses may override.
      Specified by:
      dispose in interface IContributionItem
      Overrides:
      dispose in class BaseNewWizardMenu