Package org.eclipse.jface.action
Class ToolBarContributionItem
java.lang.Object
org.eclipse.jface.action.ContributionItem
org.eclipse.jface.action.ToolBarContributionItem
- All Implemented Interfaces:
- IContributionItem,- org.eclipse.jface.internal.provisional.action.IToolBarContributionItem
@NoExtend
public class ToolBarContributionItem
extends ContributionItem
implements org.eclipse.jface.internal.provisional.action.IToolBarContributionItem
The 
ToolBarContributionItem class provides a wrapper for tool
 bar managers when used in cool bar managers. It extends
 ContributionItem but and provides some additional methods to
 customize the size of the cool item and to retrieve the underlying tool bar
 manager.
 This class may be instantiated; it is not intended to be subclassed.
- Since:
- 3.0
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intA constant used bysetMinimumItemsToShowandgetMinimumItemsToShowto indicate that all tool items should be shown in the cool item.
- 
Constructor SummaryConstructorsConstructorDescriptionConvenience method equivalent toToolBarContributionItem(new ToolBarManager(), null).ToolBarContributionItem(IToolBarManager toolBarManager) Convenience method equivalent toToolBarContributionItem(toolBarManager, null).ToolBarContributionItem(IToolBarManager toolBarManager, String id) Creates a tool bar contribution item.
- 
Method SummaryModifier and TypeMethodDescriptionvoiddispose()The default implementation of thisIContributionItemmethod does nothing.voidThe default implementation of thisIContributionItemmethod does nothing.intReturns the current height of the corresponding cool item.intReturns the current width of the corresponding cool item.intReturns the minimum number of tool items to show in the cool item.Returns the internal tool bar manager of the contribution item.booleanReturns whether chevron support is enabled.booleanA contribution item is visible iff its internal state is visible or the tool bar manager contains something other than group markers and separators.voidThe default implementation of thisIContributionItemmethod does nothing.voidsetCurrentHeight(int currentHeight) Sets the current height of the cool item.voidsetCurrentWidth(int currentWidth) Sets the current width of the cool item.voidsetMinimumItemsToShow(int minimumItemsToShow) Sets the minimum number of tool items to show in the cool item.voidsetUseChevron(boolean value) Enables or disables chevron support for the cool item.voidTheContributionItemimplementation of this method declared onIContributionItemdoes nothing.Methods inherited from class org.eclipse.jface.action.ContributionItemfill, fill, fill, getId, getParent, isDirty, isDynamic, isEnabled, isGroupMarker, isSeparator, setId, setParent, setVisible, toString, updateMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jface.action.IContributionItemfill, fill, fill, getId, isDirty, isDynamic, isEnabled, isGroupMarker, isSeparator, setParent, setVisible, updateMethods inherited from interface org.eclipse.jface.internal.provisional.action.IToolBarContributionItemgetParent
- 
Field Details- 
SHOW_ALL_ITEMSpublic static final int SHOW_ALL_ITEMSA constant used bysetMinimumItemsToShowandgetMinimumItemsToShowto indicate that all tool items should be shown in the cool item.- See Also:
 
 
- 
- 
Constructor Details- 
ToolBarContributionItempublic ToolBarContributionItem()Convenience method equivalent toToolBarContributionItem(new ToolBarManager(), null).
- 
ToolBarContributionItemConvenience method equivalent toToolBarContributionItem(toolBarManager, null).- Parameters:
- toolBarManager- the tool bar manager
 
- 
ToolBarContributionItemCreates a tool bar contribution item.- Parameters:
- toolBarManager- the tool bar manager to wrap
- id- the contribution item id, or- nullif none
 
 
- 
- 
Method Details- 
disposepublic void dispose()Description copied from class:ContributionItemThe default implementation of thisIContributionItemmethod does nothing. Subclasses may override.- Specified by:
- disposein interface- IContributionItem
- Overrides:
- disposein class- ContributionItem
 
- 
fillDescription copied from class:ContributionItemThe default implementation of thisIContributionItemmethod does nothing. Subclasses may override.- Specified by:
- fillin interface- IContributionItem
- Overrides:
- fillin class- ContributionItem
- Parameters:
- coolBar- the parent cool bar
- index- the index where the controls are inserted, or- -1to insert at the end
 
- 
getCurrentHeightpublic int getCurrentHeight()Returns the current height of the corresponding cool item.- Specified by:
- getCurrentHeightin interface- org.eclipse.jface.internal.provisional.action.IToolBarContributionItem
- Returns:
- the current height
 
- 
getCurrentWidthpublic int getCurrentWidth()Returns the current width of the corresponding cool item.- Specified by:
- getCurrentWidthin interface- org.eclipse.jface.internal.provisional.action.IToolBarContributionItem
- Returns:
- the current size
 
- 
getMinimumItemsToShowpublic int getMinimumItemsToShow()Returns the minimum number of tool items to show in the cool item.- Specified by:
- getMinimumItemsToShowin interface- org.eclipse.jface.internal.provisional.action.IToolBarContributionItem
- Returns:
- the minimum number of tool items to show, or
         SHOW_ALL_ITEMSif a value was not set
- See Also:
 
- 
getToolBarManagerReturns the internal tool bar manager of the contribution item.- Specified by:
- getToolBarManagerin interface- org.eclipse.jface.internal.provisional.action.IToolBarContributionItem
- Returns:
- the tool bar manager, or nullif one is not defined.
- See Also:
 
- 
getUseChevronpublic boolean getUseChevron()Returns whether chevron support is enabled.- Specified by:
- getUseChevronin interface- org.eclipse.jface.internal.provisional.action.IToolBarContributionItem
- Returns:
- trueif chevron support is enabled,- falseotherwise
 
- 
isVisiblepublic boolean isVisible()A contribution item is visible iff its internal state is visible or the tool bar manager contains something other than group markers and separators.- Specified by:
- isVisiblein interface- IContributionItem
- Overrides:
- isVisiblein class- ContributionItem
- Returns:
- trueif the tool bar manager contains something other than group marks and separators, and the internal state is set to be visible.
 
- 
saveWidgetStatepublic void saveWidgetState()Description copied from class:ContributionItemThe default implementation of thisIContributionItemmethod does nothing. Subclasses may override.- Specified by:
- saveWidgetStatein interface- IContributionItem
- Overrides:
- saveWidgetStatein class- ContributionItem
 
- 
setCurrentHeightpublic void setCurrentHeight(int currentHeight) Sets the current height of the cool item. Update(SIZE) should be called to adjust the widget.- Specified by:
- setCurrentHeightin interface- org.eclipse.jface.internal.provisional.action.IToolBarContributionItem
- Parameters:
- currentHeight- the current height to set
 
- 
setCurrentWidthpublic void setCurrentWidth(int currentWidth) Sets the current width of the cool item. Update(SIZE) should be called to adjust the widget.- Specified by:
- setCurrentWidthin interface- org.eclipse.jface.internal.provisional.action.IToolBarContributionItem
- Parameters:
- currentWidth- the current width to set
 
- 
setMinimumItemsToShowpublic void setMinimumItemsToShow(int minimumItemsToShow) Sets the minimum number of tool items to show in the cool item. If this number is less than the total tool items, a chevron will appear and the hidden tool items appear in a drop down menu. By default, all the tool items are shown in the cool item.- Specified by:
- setMinimumItemsToShowin interface- org.eclipse.jface.internal.provisional.action.IToolBarContributionItem
- Parameters:
- minimumItemsToShow- the minimum number of tool items to show.
- See Also:
 
- 
setUseChevronpublic void setUseChevron(boolean value) Enables or disables chevron support for the cool item. By default, chevron support is enabled.- Specified by:
- setUseChevronin interface- org.eclipse.jface.internal.provisional.action.IToolBarContributionItem
- Parameters:
- value-- trueto enable chevron support,- falseotherwise.
 
- 
updateDescription copied from class:ContributionItemTheContributionItemimplementation of this method declared onIContributionItemdoes nothing. Subclasses should override to update their state.- Specified by:
- updatein interface- IContributionItem
- Overrides:
- updatein class- ContributionItem
- Parameters:
- propertyName- the id of the changed property
 
 
-