Interface IContributionManager

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void add​(IAction action)
      Adds an action as a contribution item to this manager.
      void add​(IContributionItem item)
      Adds a contribution item to this manager.
      void appendToGroup​(java.lang.String groupName, IAction action)
      Adds a contribution item for the given action at the end of the group with the given name.
      void appendToGroup​(java.lang.String groupName, IContributionItem item)
      Adds a contribution item to this manager at the end of the group with the given name.
      IContributionItem find​(java.lang.String id)
      Finds the contribution item with the given id.
      IContributionItem[] getItems()
      Returns all contribution items known to this manager.
      IContributionManagerOverrides getOverrides()
      Returns the overrides for the items of this manager.
      void insertAfter​(java.lang.String id, IAction action)
      Inserts a contribution item for the given action after the item with the given id.
      void insertAfter​(java.lang.String id, IContributionItem item)
      Inserts a contribution item after the item with the given id.
      void insertBefore​(java.lang.String id, IAction action)
      Inserts a contribution item for the given action before the item with the given id.
      void insertBefore​(java.lang.String id, IContributionItem item)
      Inserts a contribution item before the item with the given id.
      boolean isDirty()
      Returns whether the list of contributions has recently changed and has yet to be reflected in the corresponding widgets.
      boolean isEmpty()
      Returns whether this manager has any contribution items.
      void markDirty()
      Marks this contribution manager as dirty.
      void prependToGroup​(java.lang.String groupName, IAction action)
      Adds a contribution item for the given action at the beginning of the group with the given name.
      void prependToGroup​(java.lang.String groupName, IContributionItem item)
      Adds a contribution item to this manager at the beginning of the group with the given name.
      IContributionItem remove​(java.lang.String id)
      Removes and returns the contribution item with the given id from this manager.
      IContributionItem remove​(IContributionItem item)
      Removes the given contribution item from the contribution items known to this manager.
      void removeAll()
      Removes all contribution items from this manager.
      void update​(boolean force)
      Updates this manager's underlying widget(s) with any changes which have been made to it or its items.
    • Method Detail

      • add

        void add​(IAction action)
        Adds an action as a contribution item to this manager. Equivalent to add(new ActionContributionItem(action)).
        Parameters:
        action - the action, this cannot be null
      • add

        void add​(IContributionItem item)
        Adds a contribution item to this manager.
        Parameters:
        item - the contribution item, this cannot be null
      • appendToGroup

        void appendToGroup​(java.lang.String groupName,
                           IAction action)
        Adds a contribution item for the given action at the end of the group with the given name. Equivalent to appendToGroup(groupName,new ActionContributionItem(action)).
        Parameters:
        groupName - the name of the group
        action - the action
        Throws:
        java.lang.IllegalArgumentException - if there is no group with the given name
      • appendToGroup

        void appendToGroup​(java.lang.String groupName,
                           IContributionItem item)
        Adds a contribution item to this manager at the end of the group with the given name.
        Parameters:
        groupName - the name of the group
        item - the contribution item
        Throws:
        java.lang.IllegalArgumentException - if there is no group with the given name
      • find

        IContributionItem find​(java.lang.String id)
        Finds the contribution item with the given id.
        Parameters:
        id - the contribution item id
        Returns:
        the contribution item, or null if no item with the given id can be found
      • getItems

        IContributionItem[] getItems()
        Returns all contribution items known to this manager.
        Returns:
        a list of contribution items
      • getOverrides

        IContributionManagerOverrides getOverrides()
        Returns the overrides for the items of this manager.
        Returns:
        the overrides for the items of this manager
        Since:
        2.0
      • insertAfter

        void insertAfter​(java.lang.String id,
                         IAction action)
        Inserts a contribution item for the given action after the item with the given id. Equivalent to insertAfter(id,new ActionContributionItem(action)).
        Parameters:
        id - the contribution item id
        action - the action to insert
        Throws:
        java.lang.IllegalArgumentException - if there is no item with the given id
      • insertAfter

        void insertAfter​(java.lang.String id,
                         IContributionItem item)
        Inserts a contribution item after the item with the given id.
        Parameters:
        id - the contribution item id
        item - the contribution item to insert
        Throws:
        java.lang.IllegalArgumentException - if there is no item with the given id
      • insertBefore

        void insertBefore​(java.lang.String id,
                          IAction action)
        Inserts a contribution item for the given action before the item with the given id. Equivalent to insertBefore(id,new ActionContributionItem(action)).
        Parameters:
        id - the contribution item id
        action - the action to insert
        Throws:
        java.lang.IllegalArgumentException - if there is no item with the given id
      • insertBefore

        void insertBefore​(java.lang.String id,
                          IContributionItem item)
        Inserts a contribution item before the item with the given id.
        Parameters:
        id - the contribution item id
        item - the contribution item to insert
        Throws:
        java.lang.IllegalArgumentException - if there is no item with the given id
      • isDirty

        boolean isDirty()
        Returns whether the list of contributions has recently changed and has yet to be reflected in the corresponding widgets.
        Returns:
        true if this manager is dirty, and false if it is up-to-date
      • isEmpty

        boolean isEmpty()
        Returns whether this manager has any contribution items.
        Returns:
        true if there are no items, and false otherwise
      • markDirty

        void markDirty()
        Marks this contribution manager as dirty.
      • prependToGroup

        void prependToGroup​(java.lang.String groupName,
                            IAction action)
        Adds a contribution item for the given action at the beginning of the group with the given name. Equivalent to prependToGroup(groupName,new ActionContributionItem(action)).
        Parameters:
        groupName - the name of the group
        action - the action
        Throws:
        java.lang.IllegalArgumentException - if there is no group with the given name
      • prependToGroup

        void prependToGroup​(java.lang.String groupName,
                            IContributionItem item)
        Adds a contribution item to this manager at the beginning of the group with the given name.
        Parameters:
        groupName - the name of the group
        item - the contribution item
        Throws:
        java.lang.IllegalArgumentException - if there is no group with the given name
      • remove

        IContributionItem remove​(java.lang.String id)
        Removes and returns the contribution item with the given id from this manager. Returns null if this manager has no contribution items with the given id.
        Parameters:
        id - the contribution item id
        Returns:
        the item that was found and removed, or null if none
      • remove

        IContributionItem remove​(IContributionItem item)
        Removes the given contribution item from the contribution items known to this manager.
        Parameters:
        item - the contribution item
        Returns:
        the item parameter if the item was removed, and null if it was not found
      • removeAll

        void removeAll()
        Removes all contribution items from this manager.

        Note: The items will not get disposed.

      • update

        void update​(boolean force)
        Updates this manager's underlying widget(s) with any changes which have been made to it or its items. Normally changes to a contribution manager merely mark it as dirty, without updating the underlying widgets. This brings the underlying widgets up to date with any changes.
        Parameters:
        force - true means update even if not dirty, and false for normal incremental updating