Class EditorMenuManager

All Implemented Interfaces:
IContributionItem, IContributionManager, IMenuManager

public class EditorMenuManager extends SubMenuManager
An EditorMenuManager is used to sort the contributions made by an editor so that they always appear after the action sets.
  • Constructor Details

    • EditorMenuManager

      public EditorMenuManager(IMenuManager mgr)
      Constructs a new editor manager.
  • Method Details

    • getItems

      public IContributionItem[] getItems()
      Description copied from interface: IContributionManager
      Returns all contribution items known to this manager.
      Specified by:
      getItems in interface IContributionManager
      Overrides:
      getItems in class SubContributionManager
      Returns:
      a list of contribution items
    • getOverrides

      public IContributionManagerOverrides getOverrides()
      Description copied from interface: IContributionManager
      Returns the overrides for the items of this manager.
      Specified by:
      getOverrides in interface IContributionManager
      Overrides:
      getOverrides in class SubContributionManager
      Returns:
      the overrides for the items of this manager
    • prependToGroup

      public void prependToGroup(String groupName, IContributionItem item)
      Description copied from interface: IContributionManager
      Adds a contribution item to this manager at the beginning of the group with the given name.
      Specified by:
      prependToGroup in interface IContributionManager
      Overrides:
      prependToGroup in class SubContributionManager
      Parameters:
      groupName - the name of the group
      item - the contribution item
    • appendToGroup

      public void appendToGroup(String groupName, IContributionItem item)
      Description copied from interface: IContributionManager
      Adds a contribution item to this manager at the end of the group with the given name.
      Specified by:
      appendToGroup in interface IContributionManager
      Overrides:
      appendToGroup in class SubContributionManager
      Parameters:
      groupName - the name of the group
      item - the contribution item
    • setVisible

      public void setVisible(boolean visible, boolean forceVisibility)
      Sets the visibility of the manager. If the visibility is true then each item within the manager appears within the parent manager. Otherwise, the items are not visible.

      If force visibility is true, or grayed out if force visibility is false

      This is a workaround for the layout flashing when editors contribute large amounts of items.

      Parameters:
      visible - the new visibility
      forceVisibility - whether to change the visibility or just the enablement state.
    • setEnabledAllowed

      public void setEnabledAllowed(boolean enabledAllowed)
      Sets the enablement ability of all the items contributed by the editor.
      Parameters:
      enabledAllowed - true if the items may enable
      Since:
      2.0
    • wrapMenu

      protected SubMenuManager wrapMenu(IMenuManager menu)
      Description copied from class: SubMenuManager
      Wraps a menu manager in a sub menu manager, and returns the new wrapper.
      Overrides:
      wrapMenu in class SubMenuManager
      Parameters:
      menu - the menu manager to wrap
      Returns:
      the new wrapped menu manager
    • getAllContributedActions

      protected IAction[] getAllContributedActions()
    • getAllContributedActions

      protected void getAllContributedActions(HashSet<IAction> set)
    • getAllContributedActions

      protected void getAllContributedActions(HashSet<IAction> set, IContributionItem item)