Eclipse Platform
2.0

org.eclipse.jface.action
Class SubContributionItem

java.lang.Object
  |
  +--org.eclipse.jface.action.SubContributionItem
All Implemented Interfaces:
IContributionItem

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
SubContributionItem(IContributionItem item)
          Creates a new SubContributionItem.
 
Method Summary
 void fill(Composite parent)
          Fills the given composite control 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.
 IContributionItem getInnerItem()
          Returns the inner contribution item.
 boolean isDynamic()
          Returns whether this contribution item is dynamic.
 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 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubContributionItem

public SubContributionItem(IContributionItem item)
Creates a new SubContributionItem.

Method Detail

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

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:
GroupMarker, IContributionManager.appendToGroup(java.lang.String, org.eclipse.jface.action.IAction), IContributionManager.prependToGroup(java.lang.String, org.eclipse.jface.action.IAction)

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:
Separator

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

Eclipse Platform
2.0

Copyright (c) IBM Corp. and others 2000, 2002. All Rights Reserved.