Class SubContributionItem

java.lang.Object
org.eclipse.jface.action.SubContributionItem
All Implemented Interfaces:
IContributionItem
Direct Known Subclasses:
ActionSetContributionItem

@NoExtend public class SubContributionItem extends Object implements IContributionItem
A SubContributionItem is a wrapper for an IContributionItem. It is used within a SubContributionManager to control the visibility of items.

This class is not intended to be subclassed.

  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new SubContributionItem.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    The default implementation of this IContributionItem delegates to the inner 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.
    Returns the identifier of this contribution item.
    Returns the inner contribution item.
    boolean
    Returns whether this contribution item is dirty.
    boolean
    Returns whether this contribution item is dynamic.
    boolean
    Returns whether this contribution item is enabled.
    boolean
    Returns whether this contribution item is a group marker.
    boolean
    Returns whether this contribution item is a separator.
    boolean
    Returns whether this contribution item is visibile within its manager.
    void
    Saves any state information of the control(s) owned by this contribution item.
    void
    Sets the parent manager of this item
    void
    setVisible(boolean visible)
    Sets whether this contribution item is visibile within its manager.
     
    void
    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
    Updates any SWT controls cached by this contribution item with changes for the the given property.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • SubContributionItem

      public SubContributionItem(IContributionItem item)
      Creates a new SubContributionItem.
      Parameters:
      item - the contribution item to be wrapped
  • Method Details

    • dispose

      public void dispose()
      The default implementation of this IContributionItem delegates to the inner item. Subclasses may override.
      Specified by:
      dispose in interface IContributionItem
    • fill

      public void fill(Composite parent)
      Description copied from interface: IContributionItem
      Fills the given composite control with controls representing this contribution item. Used by StatusLineManager.
      Specified by:
      fill in interface IContributionItem
      Parameters:
      parent - the parent control
    • fill

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

      public void fill(ToolBar parent, int index)
      Description copied from interface: IContributionItem
      Fills the given tool bar with controls representing this contribution item. Used by ToolBarManager.
      Specified by:
      fill in interface IContributionItem
      Parameters:
      parent - the parent tool bar
      index - the index where the controls are inserted, or -1 to insert at the end
    • getId

      public String getId()
      Description copied from interface: IContributionItem
      Returns the identifier of this contribution item. The id is used for retrieving an item from its manager.
      Specified by:
      getId in interface IContributionItem
      Returns:
      the contribution item identifier, or null if none
    • getInnerItem

      public IContributionItem getInnerItem()
      Returns the inner contribution item.
      Returns:
      the inner contribution item
    • isEnabled

      public boolean isEnabled()
      Description copied from interface: IContributionItem
      Returns whether this contribution item is enabled.
      Specified by:
      isEnabled in interface IContributionItem
      Returns:
      true if this item is enabled
    • isDirty

      public boolean isDirty()
      Description copied from interface: IContributionItem
      Returns whether this contribution item is dirty. A dirty item will be recreated when the action bar is updated.
      Specified by:
      isDirty in interface IContributionItem
      Returns:
      true if this item is dirty
    • isDynamic

      public boolean isDynamic()
      Description copied from interface: IContributionItem
      Returns whether this contribution item is dynamic. A dynamic contribution item contributes items conditionally, dependent on some internal state.
      Specified by:
      isDynamic in interface IContributionItem
      Returns:
      true if this item is dynamic, and false for normal items
    • isGroupMarker

      public boolean isGroupMarker()
      Description copied from interface: IContributionItem
      Returns whether this contribution item is a group marker. This information is used when adding items to a group.
      Specified by:
      isGroupMarker in interface IContributionItem
      Returns:
      true if this item is a group marker, and false for normal items
      See Also:
    • isSeparator

      public boolean isSeparator()
      Description copied from interface: IContributionItem
      Returns whether this contribution item is a separator. This information is used to enable hiding of unnecessary separators.
      Specified by:
      isSeparator in interface IContributionItem
      Returns:
      true if this item is a separator, and false for normal items
      See Also:
    • isVisible

      public boolean isVisible()
      Description copied from interface: IContributionItem
      Returns whether this contribution item is visibile within its manager.
      Specified by:
      isVisible in interface IContributionItem
      Returns:
      true if this item is visible, and false otherwise
    • setParent

      public void setParent(IContributionManager parent)
      Description copied from interface: IContributionItem
      Sets the parent manager of this item
      Specified by:
      setParent in interface IContributionItem
      Parameters:
      parent - the parent contribution manager
    • setVisible

      public void setVisible(boolean visible)
      Description copied from interface: IContributionItem
      Sets whether this contribution item is visibile within its manager.
      Specified by:
      setVisible in interface IContributionItem
      Parameters:
      visible - true if this item should be visible, and false otherwise
    • update

      public void update()
      Description copied from interface: IContributionItem
      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.
      Specified by:
      update in interface IContributionItem
    • update

      public void update(String id)
      Description copied from interface: IContributionItem
      Updates any SWT controls cached by this contribution item with changes for the the given property.
      Specified by:
      update in interface IContributionItem
      Parameters:
      id - the id of the changed property
    • fill

      public void fill(CoolBar parent, int index)
      Description copied from interface: IContributionItem
      Fills the given cool bar with controls representing this contribution item. Used by CoolBarManager.
      Specified by:
      fill in interface IContributionItem
      Parameters:
      parent - the parent cool bar
      index - the index where the controls are inserted, or -1 to insert at the end
    • saveWidgetState

      public void saveWidgetState()
      Description copied from interface: IContributionItem
      Saves any state information of the control(s) owned by this contribution item. The contribution manager calls this method before disposing of the controls.
      Specified by:
      saveWidgetState in interface IContributionItem
    • toString

      public String toString()
      Overrides:
      toString in class Object