Package org.eclipse.jface.action
Class SubContributionItem
java.lang.Object
org.eclipse.jface.action.SubContributionItem
- All Implemented Interfaces:
IContributionItem
- Direct Known Subclasses:
ActionSetContributionItem
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
ConstructorsConstructorDescriptionCreates a newSubContributionItem. -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()The default implementation of thisIContributionItemdelegates to the inner item.voidFills the given composite control with controls representing this contribution item.voidFills the given cool bar with controls representing this contribution item.voidFills the given menu with controls representing this contribution item.voidFills the given tool bar with controls representing this contribution item.getId()Returns the identifier of this contribution item.Returns the inner contribution item.booleanisDirty()Returns whether this contribution item is dirty.booleanReturns whether this contribution item is dynamic.booleanReturns whether this contribution item is enabled.booleanReturns whether this contribution item is a group marker.booleanReturns whether this contribution item is a separator.booleanReturns whether this contribution item is visibile within its manager.voidSaves 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.toString()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.voidUpdates any SWT controls cached by this contribution item with changes for the the given property.
-
Constructor Details
-
SubContributionItem
Creates a newSubContributionItem.- Parameters:
item- the contribution item to be wrapped
-
-
Method Details
-
dispose
public void dispose()The default implementation of thisIContributionItemdelegates to the inner item. Subclasses may override.- Specified by:
disposein interfaceIContributionItem
-
fill
Description copied from interface:IContributionItemFills the given composite control with controls representing this contribution item. Used byStatusLineManager.- Specified by:
fillin interfaceIContributionItem- Parameters:
parent- the parent control
-
fill
Description copied from interface:IContributionItemFills the given menu with controls representing this contribution item. Used byMenuManager.- Specified by:
fillin interfaceIContributionItem- Parameters:
parent- the parent menuindex- the index where the controls are inserted, or-1to insert at the end
-
fill
Description copied from interface:IContributionItemFills the given tool bar with controls representing this contribution item. Used byToolBarManager.- Specified by:
fillin interfaceIContributionItem- Parameters:
parent- the parent tool barindex- the index where the controls are inserted, or-1to insert at the end
-
getId
Description copied from interface:IContributionItemReturns the identifier of this contribution item. The id is used for retrieving an item from its manager.- Specified by:
getIdin interfaceIContributionItem- Returns:
- the contribution item identifier, or
nullif none
-
getInnerItem
Returns the inner contribution item.- Returns:
- the inner contribution item
-
isEnabled
public boolean isEnabled()Description copied from interface:IContributionItemReturns whether this contribution item is enabled.- Specified by:
isEnabledin interfaceIContributionItem- Returns:
trueif this item is enabled
-
isDirty
public boolean isDirty()Description copied from interface:IContributionItemReturns whether this contribution item is dirty. A dirty item will be recreated when the action bar is updated.- Specified by:
isDirtyin interfaceIContributionItem- Returns:
trueif this item is dirty
-
isDynamic
public boolean isDynamic()Description copied from interface:IContributionItemReturns whether this contribution item is dynamic. A dynamic contribution item contributes items conditionally, dependent on some internal state.- Specified by:
isDynamicin interfaceIContributionItem- Returns:
trueif this item is dynamic, andfalsefor normal items
-
isGroupMarker
public boolean isGroupMarker()Description copied from interface:IContributionItemReturns whether this contribution item is a group marker. This information is used when adding items to a group.- Specified by:
isGroupMarkerin interfaceIContributionItem- Returns:
trueif this item is a group marker, andfalsefor normal items- See Also:
-
isSeparator
public boolean isSeparator()Description copied from interface:IContributionItemReturns whether this contribution item is a separator. This information is used to enable hiding of unnecessary separators.- Specified by:
isSeparatorin interfaceIContributionItem- Returns:
trueif this item is a separator, andfalsefor normal items- See Also:
-
isVisible
public boolean isVisible()Description copied from interface:IContributionItemReturns whether this contribution item is visibile within its manager.- Specified by:
isVisiblein interfaceIContributionItem- Returns:
trueif this item is visible, andfalseotherwise
-
setParent
Description copied from interface:IContributionItemSets the parent manager of this item- Specified by:
setParentin interfaceIContributionItem- Parameters:
parent- the parent contribution manager
-
setVisible
public void setVisible(boolean visible) Description copied from interface:IContributionItemSets whether this contribution item is visibile within its manager.- Specified by:
setVisiblein interfaceIContributionItem- Parameters:
visible-trueif this item should be visible, andfalseotherwise
-
update
public void update()Description copied from interface:IContributionItemUpdates 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:
updatein interfaceIContributionItem
-
update
Description copied from interface:IContributionItemUpdates any SWT controls cached by this contribution item with changes for the the given property.- Specified by:
updatein interfaceIContributionItem- Parameters:
id- the id of the changed property
-
fill
Description copied from interface:IContributionItemFills the given cool bar with controls representing this contribution item. Used byCoolBarManager.- Specified by:
fillin interfaceIContributionItem- Parameters:
parent- the parent cool barindex- the index where the controls are inserted, or-1to insert at the end
-
saveWidgetState
public void saveWidgetState()Description copied from interface:IContributionItemSaves 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:
saveWidgetStatein interfaceIContributionItem
-
toString
-