Package org.eclipse.jface.action
Interface IContributionItem
-
- All Known Subinterfaces:
IMenuManager
- All Known Implementing Classes:
AbstractGroupMarker,ActionContributionItem,BaseNewWizardMenu,BreakpointTypesContribution,CommandContributionItem,CompoundContributionItem,ContributionItem,ControlContribution,CoolItemGroupMarker,GroupMarker,org.eclipse.ui.internal.menus.InternalControlContribution,MenuManager,NewWizardMenu,OpenNewPageMenu,OpenNewWindowMenu,OpenPerspectiveMenu,OpenWithMenu,PerspectiveMenu,Separator,StatusLineContributionItem,StatusLineContributionItem,SubContributionItem,SubMenuManager,ToolBarContributionItem,WorkbenchWindowControlContribution
public interface IContributionItemA contribution item represents a contribution to a shared UI resource such as a menu or tool bar. More generally, contribution items are managed by a contribution manager. For instance, in a tool bar a contribution item is a tool bar button or a separator. In a menu bar a contribution item is a menu, and in a menu a contribution item is a menu item or separator.A contribution item can realize itself in different SWT widgets, using the different
fillmethods. The same type of contribution item can be used with aMenuBarManager,ToolBarManager,CoolBarManager, or aStatusLineManager.This interface is internal to the framework; it should not be implemented outside the framework.
- See Also:
IContributionManager- Restriction:
- This interface is not intended to be implemented by clients.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddispose()Disposes of this contribution item.voidfill(Composite parent)Fills the given composite control with controls representing this contribution item.voidfill(CoolBar parent, int index)Fills the given cool bar with controls representing this contribution item.voidfill(Menu parent, int index)Fills the given menu with controls representing this contribution item.voidfill(ToolBar parent, int index)Fills the given tool bar with controls representing this contribution item.StringgetId()Returns the identifier of this contribution item.booleanisDirty()Returns whether this contribution item is dirty.booleanisDynamic()Returns whether this contribution item is dynamic.booleanisEnabled()Returns whether this contribution item is enabled.booleanisGroupMarker()Returns whether this contribution item is a group marker.booleanisSeparator()Returns whether this contribution item is a separator.booleanisVisible()Returns whether this contribution item is visibile within its manager.voidsaveWidgetState()Saves any state information of the control(s) owned by this contribution item.voidsetParent(IContributionManager parent)Sets the parent manager of this itemvoidsetVisible(boolean visible)Sets whether this contribution item is visibile within its manager.voidupdate()Updates any SWT controls cached by this contribution item with any changes which have been made to this contribution item since the last update.voidupdate(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 byStatusLineManager.- Parameters:
parent- the parent control
-
fill
void fill(Menu parent, int index)
Fills the given menu with controls representing this contribution item. Used byMenuManager.- Parameters:
parent- the parent menuindex- the index where the controls are inserted, or-1to insert at the end
-
fill
void fill(ToolBar parent, int index)
Fills the given tool bar with controls representing this contribution item. Used byToolBarManager.- Parameters:
parent- the parent tool barindex- the index where the controls are inserted, or-1to insert at the end
-
fill
void fill(CoolBar parent, int index)
Fills the given cool bar with controls representing this contribution item. Used byCoolBarManager.- Parameters:
parent- the parent cool barindex- the index where the controls are inserted, or-1to 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
nullif none
-
isEnabled
boolean isEnabled()
Returns whether this contribution item is enabled.- Returns:
trueif 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:
trueif 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:
trueif this item is dynamic, andfalsefor normal items
-
isGroupMarker
boolean isGroupMarker()
Returns whether this contribution item is a group marker. This information is used when adding items to a group.- Returns:
trueif this item is a group marker, andfalsefor normal items- See Also:
GroupMarker,IContributionManager.appendToGroup(String, IContributionItem),IContributionManager.prependToGroup(String, IContributionItem)
-
isSeparator
boolean isSeparator()
Returns whether this contribution item is a separator. This information is used to enable hiding of unnecessary separators.- Returns:
trueif this item is a separator, andfalsefor normal items- See Also:
Separator
-
isVisible
boolean isVisible()
Returns whether this contribution item is visibile within its manager.- Returns:
trueif this item is visible, andfalseotherwise
-
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-trueif this item should be visible, andfalseotherwise
-
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
-
-