Interface IContributionItem

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void dispose()
      Disposes of this contribution item.
      void fill​(Composite parent)
      Fills the given composite control with controls representing this contribution item.
      void fill​(CoolBar parent, int index)
      Fills the given cool bar with controls representing this contribution item.
      void fill​(Menu parent, int index)
      Fills the given menu with controls representing this contribution item.
      void fill​(ToolBar parent, int index)
      Fills the given tool bar with controls representing this contribution item.
      String getId()
      Returns the identifier of this contribution item.
      boolean isDirty()
      Returns whether this contribution item is dirty.
      boolean isDynamic()
      Returns whether this contribution item is dynamic.
      boolean isEnabled()
      Returns whether this contribution item is enabled.
      boolean isGroupMarker()
      Returns whether this contribution item is a group marker.
      boolean isSeparator()
      Returns whether this contribution item is a separator.
      boolean isVisible()
      Returns whether this contribution item is visibile within its manager.
      void saveWidgetState()
      Saves any state information of the control(s) owned by this contribution item.
      void setParent​(IContributionManager parent)
      Sets the parent manager of this item
      void setVisible​(boolean visible)
      Sets whether this contribution item is visibile within its manager.
      void update()
      Updates any SWT controls cached by this contribution item with any changes which have been made to this contribution item since the last update.
      void update​(String id)
      Updates any SWT controls cached by this contribution item with changes for the the given property.
    • Method Detail

      • dispose

        void dispose()
        Disposes of this contribution item. Called by the parent contribution manager when the manager is being disposed. Clients should not call this method directly, unless they have removed this contribution item from the containing IContributionManager before the contribution lifecycle has ended.
        Since:
        2.1
      • fill

        void fill​(Composite parent)
        Fills the given composite control with controls representing this contribution item. Used by StatusLineManager.
        Parameters:
        parent - the parent control
      • fill

        void fill​(Menu parent,
                  int index)
        Fills the given menu with controls representing this contribution item. Used by MenuManager.
        Parameters:
        parent - the parent menu
        index - the index where the controls are inserted, or -1 to insert at the end
      • fill

        void fill​(ToolBar parent,
                  int index)
        Fills the given tool bar with controls representing this contribution item. Used by ToolBarManager.
        Parameters:
        parent - the parent tool bar
        index - the index where the controls are inserted, or -1 to insert at the end
      • fill

        void fill​(CoolBar parent,
                  int index)
        Fills the given cool bar with controls representing this contribution item. Used by CoolBarManager.
        Parameters:
        parent - the parent cool bar
        index - the index where the controls are inserted, or -1 to insert at the end
        Since:
        3.0
      • getId

        String getId()
        Returns the identifier of this contribution item. The id is used for retrieving an item from its manager.
        Returns:
        the contribution item identifier, or null if none
      • isEnabled

        boolean isEnabled()
        Returns whether this contribution item is enabled.
        Returns:
        true if this item is enabled
      • isDirty

        boolean isDirty()
        Returns whether this contribution item is dirty. A dirty item will be recreated when the action bar is updated.
        Returns:
        true if this item is dirty
      • isDynamic

        boolean isDynamic()
        Returns whether this contribution item is dynamic. A dynamic contribution item contributes items conditionally, dependent on some internal state.
        Returns:
        true if this item is dynamic, and false for normal items
      • isSeparator

        boolean isSeparator()
        Returns whether this contribution item is a separator. This information is used to enable hiding of unnecessary separators.
        Returns:
        true if this item is a separator, and false for normal items
        See Also:
        Separator
      • isVisible

        boolean isVisible()
        Returns whether this contribution item is visibile within its manager.
        Returns:
        true if this item is visible, and false otherwise
      • saveWidgetState

        void saveWidgetState()
        Saves any state information of the control(s) owned by this contribution item. The contribution manager calls this method before disposing of the controls.
        Since:
        3.0
      • setParent

        void setParent​(IContributionManager parent)
        Sets the parent manager of this item
        Parameters:
        parent - the parent contribution manager
        Since:
        2.0
      • setVisible

        void setVisible​(boolean visible)
        Sets whether this contribution item is visibile within its manager.
        Parameters:
        visible - true if this item should be visible, and false otherwise
      • update

        void update()
        Updates any SWT controls cached by this contribution item with any changes which have been made to this contribution item since the last update. Called by contribution manager update methods.
      • update

        void update​(String id)
        Updates any SWT controls cached by this contribution item with changes for the the given property.
        Parameters:
        id - the id of the changed property
        Since:
        2.0