Package org.eclipse.jface.action
Class ContributionItem
java.lang.Object
org.eclipse.jface.action.ContributionItem
- All Implemented Interfaces:
- IContributionItem
- Direct Known Subclasses:
- AbstractContributionItem,- AbstractGroupMarker,- ActionContributionItem,- ActionSetSeparator,- CommandContributionItem,- CompoundContributionItem,- ControlContribution,- OpenWithMenu,- PerspectiveMenu,- ReopenEditorMenu,- ShowInMenu,- ShowViewMenu,- StatusLineContributionItem,- StatusLineContributionItem,- SwitchToWindowMenu,- ToolBarContributionItem,- WorkingSetMenuContributionItem
An abstract base implementation for contribution items.
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedCreates a contribution item with anullid.protectedCreates a contribution item with the given (optional) id.
- 
Method SummaryModifier and TypeMethodDescriptionvoiddispose()The default implementation of thisIContributionItemmethod does nothing.voidThe default implementation of thisIContributionItemmethod does nothing.voidThe default implementation of thisIContributionItemmethod does nothing.voidThe default implementation of thisIContributionItemmethod does nothing.voidThe default implementation of thisIContributionItemmethod does nothing.getId()Returns the identifier of this contribution item.Returns the parent contribution manager, ornullif this contribution item is not currently added to a contribution manager.booleanisDirty()The default implementation of thisIContributionItemmethod returnsfalse.booleanThe default implementation of thisIContributionItemmethod returnsfalse.booleanThe default implementation of thisIContributionItemmethod returnstrue.booleanThe default implementation of thisIContributionItemmethod returnsfalse.booleanThe default implementation of thisIContributionItemmethod returnsfalse.booleanThe default implementation of thisIContributionItemmethod returns the value recorded in an internal state variable, which istrueby default.voidThe default implementation of thisIContributionItemmethod does nothing.voidThe ID for this contribution item.voidsetParent(IContributionManager parent) Sets the parent manager of this itemvoidsetVisible(boolean visible) The default implementation of thisIContributionItemmethod stores the value in an internal state variable, which istrueby default.toString()Returns a string representation of this contribution item suitable only for debugging.voidupdate()The default implementation of thisIContributionItemmethod does nothing.voidTheContributionItemimplementation of this method declared onIContributionItemdoes nothing.
- 
Constructor Details- 
ContributionItemprotected ContributionItem()Creates a contribution item with anullid. Callsthis(String)withnull.
- 
ContributionItemCreates a contribution item with the given (optional) id. The given id is used to find items in a contribution manager, and for positioning items relative to other items.- Parameters:
- id- the contribution item identifier, or- null
 
 
- 
- 
Method Details- 
disposepublic void dispose()The default implementation of thisIContributionItemmethod does nothing. Subclasses may override.- Specified by:
- disposein interface- IContributionItem
 
- 
fillThe default implementation of thisIContributionItemmethod does nothing. Subclasses may override.- Specified by:
- fillin interface- IContributionItem
- Parameters:
- parent- the parent control
 
- 
fillThe default implementation of thisIContributionItemmethod does nothing. Subclasses may override.- Specified by:
- fillin interface- IContributionItem
- Parameters:
- menu- the parent menu
- index- the index where the controls are inserted, or- -1to insert at the end
 
- 
fillThe default implementation of thisIContributionItemmethod does nothing. Subclasses may override.- Specified by:
- fillin interface- IContributionItem
- Parameters:
- parent- the parent tool bar
- index- the index where the controls are inserted, or- -1to insert at the end
 
- 
fillThe default implementation of thisIContributionItemmethod does nothing. Subclasses may override.- Specified by:
- fillin interface- IContributionItem
- Parameters:
- parent- the parent cool bar
- index- the index where the controls are inserted, or- -1to insert at the end
- Since:
- 3.0
 
- 
saveWidgetStatepublic void saveWidgetState()The default implementation of thisIContributionItemmethod does nothing. Subclasses may override.- Specified by:
- saveWidgetStatein interface- IContributionItem
- Since:
- 3.0
 
- 
getIdDescription copied from interface:IContributionItemReturns the identifier of this contribution item. The id is used for retrieving an item from its manager.- Specified by:
- getIdin interface- IContributionItem
- Returns:
- the contribution item identifier, or nullif none
 
- 
getParentReturns the parent contribution manager, ornullif this contribution item is not currently added to a contribution manager.- Returns:
- the parent contribution manager, or null
- Since:
- 2.0
 
- 
isDirtypublic boolean isDirty()The default implementation of thisIContributionItemmethod returnsfalse. Subclasses may override.- Specified by:
- isDirtyin interface- IContributionItem
- Returns:
- trueif this item is dirty
 
- 
isEnabledpublic boolean isEnabled()The default implementation of thisIContributionItemmethod returnstrue. Subclasses may override.- Specified by:
- isEnabledin interface- IContributionItem
- Returns:
- trueif this item is enabled
 
- 
isDynamicpublic boolean isDynamic()The default implementation of thisIContributionItemmethod returnsfalse. Subclasses may override.- Specified by:
- isDynamicin interface- IContributionItem
- Returns:
- trueif this item is dynamic, and- falsefor normal items
 
- 
isGroupMarkerpublic boolean isGroupMarker()The default implementation of thisIContributionItemmethod returnsfalse. Subclasses may override.- Specified by:
- isGroupMarkerin interface- IContributionItem
- Returns:
- trueif this item is a group marker, and- falsefor normal items
- See Also:
 
- 
isSeparatorpublic boolean isSeparator()The default implementation of thisIContributionItemmethod returnsfalse. Subclasses may override.- Specified by:
- isSeparatorin interface- IContributionItem
- Returns:
- trueif this item is a separator, and- falsefor normal items
- See Also:
 
- 
isVisiblepublic boolean isVisible()The default implementation of thisIContributionItemmethod returns the value recorded in an internal state variable, which istrueby default.setVisibleshould be used to change this setting.- Specified by:
- isVisiblein interface- IContributionItem
- Returns:
- trueif this item is visible, and- falseotherwise
 
- 
setVisiblepublic void setVisible(boolean visible) The default implementation of thisIContributionItemmethod stores the value in an internal state variable, which istrueby default.- Specified by:
- setVisiblein interface- IContributionItem
- Parameters:
- visible-- trueif this item should be visible, and- falseotherwise
 
- 
toStringReturns a string representation of this contribution item suitable only for debugging.
- 
updatepublic void update()The default implementation of thisIContributionItemmethod does nothing. Subclasses may override.- Specified by:
- updatein interface- IContributionItem
 
- 
setParentDescription copied from interface:IContributionItemSets the parent manager of this item- Specified by:
- setParentin interface- IContributionItem
- Parameters:
- parent- the parent contribution manager
 
- 
updateTheContributionItemimplementation of this method declared onIContributionItemdoes nothing. Subclasses should override to update their state.- Specified by:
- updatein interface- IContributionItem
- Parameters:
- id- the id of the changed property
 
- 
setIdThe ID for this contribution item. It should be set once either in the constructor or using this method.- Parameters:
- itemId- new item id
- Since:
- 3.4
- See Also:
 
 
-