Class CoolBarToTrimManager
- All Implemented Interfaces:
IContributionManager,ICoolBarManager,org.eclipse.jface.internal.provisional.action.ICoolBarManager2
- Since:
- 3.5
-
Field Summary
FieldsFields inherited from interface org.eclipse.jface.action.ICoolBarManager
SIZE -
Constructor Summary
ConstructorsConstructorDescriptionCoolBarToTrimManager(MApplication app, MTrimmedWindow window, List<MTrimElement> workbenchTrimElements, IRendererFactory rf) -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an action as a contribution item to this manager.voidadd(IContributionItem item) Adds a contribution item to this manager.voidadd(IToolBarManager toolBarManager) A convenience method to add a tool bar as a contribution item to this cool bar manager.voidappendToGroup(String groupName, IAction action) Adds a contribution item for the given action at the end of the group with the given name.voidappendToGroup(String groupName, IContributionItem item) Adds a contribution item to this manager at the end of the group with the given name.createControl2(Composite parent) Creates and returns this manager's control.voiddispose()Disposes the resources for this manager.Finds the contribution item with the given id.Returns the context menu manager used by this cool bar manager.Returns the bar control for this manager.getItems()Returns all contribution items known to this manager.booleanReturns whether the layout of the underlying cool bar widget is locked.TheContributionManagerimplementation of this method declared onIContributionManagerreturns the current overrides.intgetStyle()Returns the style of the underlying cool bar widget.static StringgetToolbarLabel(MApplication application, MUIElement elt) voidinsertAfter(String id, IAction action) Inserts a contribution item for the given action after the item with the given id.voidinsertAfter(String id, IContributionItem item) Inserts a contribution item after the item with the given id.voidinsertBefore(String id, IAction action) Inserts a contribution item for the given action before the item with the given id.voidinsertBefore(String id, IContributionItem item) Inserts a contribution item before the item with the given id.booleanisDirty()Returns whether the list of contributions has recently changed and has yet to be reflected in the corresponding widgets.booleanisEmpty()Returns whether this manager has any contribution items.voidMarks this contribution manager as dirty.voidprependToGroup(String groupName, IAction action) Adds a contribution item for the given action at the beginning of the group with the given name.voidprependToGroup(String groupName, IContributionItem item) Adds a contribution item to this manager at the beginning of the group with the given name.voidrefresh()Synchronizes the visual order of the cool items in the control with this manager's internal data structures.Removes and returns the contribution item with the given id from this manager.remove(IContributionItem item) Removes the given contribution item from the contribution items known to this manager.voidRemoves all contribution items from this manager.voidRestores the canonical order of this cool bar manager.voidsetContextMenuManager(IMenuManager menuManager) Sets the context menu of this cool bar manager to the given menu manager.voidsetItems(IContributionItem[] newItems) Replaces the current items with the given items.voidsetLockLayout(boolean value) Locks or unlocks the layout of the underlying cool bar widget.voidsetOverrides(IContributionManagerOverrides newOverrides) Sets the overrides for this contribution managervoidupdate(boolean force) Updates this manager's underlying widget(s) with any changes which have been made to it or its items.Methods inherited from class org.eclipse.jface.action.ContributionManager
allowItem, dumpStatistics, getSize, hasDynamicItems, indexOf, indexOf, insert, internalSetItems, itemAdded, itemRemoved, replaceItem, setDirty
-
Field Details
-
OBJECT
- See Also:
-
-
Constructor Details
-
CoolBarToTrimManager
public CoolBarToTrimManager(MApplication app, MTrimmedWindow window, List<MTrimElement> workbenchTrimElements, IRendererFactory rf)
-
-
Method Details
-
add
Description copied from interface:IContributionManagerAdds an action as a contribution item to this manager. Equivalent toadd(new ActionContributionItem(action)).- Specified by:
addin interfaceIContributionManager- Overrides:
addin classContributionManager- Parameters:
action- the action, this cannot benull
-
add
Description copied from interface:IContributionManagerAdds a contribution item to this manager.- Specified by:
addin interfaceIContributionManager- Overrides:
addin classContributionManager- Parameters:
item- the contribution item, this cannot benull
-
getToolbarLabel
-
add
Description copied from interface:ICoolBarManagerA convenience method to add a tool bar as a contribution item to this cool bar manager. Equivalent toadd(new ToolBarContributionManager(toolBarManager)).- Specified by:
addin interfaceICoolBarManager- Parameters:
toolBarManager- the tool bar manager to be added- See Also:
-
appendToGroup
Description copied from interface:IContributionManagerAdds a contribution item for the given action at the end of the group with the given name. Equivalent toappendToGroup(groupName,new ActionContributionItem(action)).- Specified by:
appendToGroupin interfaceIContributionManager- Overrides:
appendToGroupin classContributionManager- Parameters:
groupName- the name of the groupaction- the action
-
appendToGroup
Description copied from interface:IContributionManagerAdds a contribution item to this manager at the end of the group with the given name.- Specified by:
appendToGroupin interfaceIContributionManager- Overrides:
appendToGroupin classContributionManager- Parameters:
groupName- the name of the groupitem- the contribution item
-
createControl2
Description copied from interface:org.eclipse.jface.internal.provisional.action.ICoolBarManager2Creates and returns this manager's control. Does not create a new control if one already exists.- Specified by:
createControl2in interfaceorg.eclipse.jface.internal.provisional.action.ICoolBarManager2- Parameters:
parent- the parent control- Returns:
- the control
-
dispose
public void dispose()Description copied from interface:org.eclipse.jface.internal.provisional.action.ICoolBarManager2Disposes the resources for this manager.EXPERIMENTAL. This class or interface has been added as part of a work in progress. There is a guarantee neither that this API will work nor that it will remain the same. Please do not use this API without consulting with the Platform/UI team.
- Specified by:
disposein interfaceorg.eclipse.jface.internal.provisional.action.ICoolBarManager2
-
find
Description copied from interface:IContributionManagerFinds the contribution item with the given id.- Specified by:
findin interfaceIContributionManager- Overrides:
findin classContributionManager- Parameters:
id- the contribution item id- Returns:
- the contribution item, or
nullif no item with the given id can be found
-
getContextMenuManager
Description copied from interface:ICoolBarManagerReturns the context menu manager used by this cool bar manager. This context menu manager is used by the cool bar manager except for cool items that provide their own.- Specified by:
getContextMenuManagerin interfaceICoolBarManager- Returns:
- the context menu manager, or
nullif none - See Also:
-
getControl2
Description copied from interface:org.eclipse.jface.internal.provisional.action.ICoolBarManager2Returns the bar control for this manager.EXPERIMENTAL. This class or interface has been added as part of a work in progress. There is a guarantee neither that this API will work nor that it will remain the same. Please do not use this API without consulting with the Platform/UI team.
- Specified by:
getControl2in interfaceorg.eclipse.jface.internal.provisional.action.ICoolBarManager2- Returns:
- the bar control, or
nullif none
-
getItems
Description copied from interface:IContributionManagerReturns all contribution items known to this manager.- Specified by:
getItemsin interfaceIContributionManager- Overrides:
getItemsin classContributionManager- Returns:
- a list of contribution items
-
getLockLayout
public boolean getLockLayout()Description copied from interface:ICoolBarManagerReturns whether the layout of the underlying cool bar widget is locked.- Specified by:
getLockLayoutin interfaceICoolBarManager- Returns:
trueif cool bar layout is locked,falseotherwise
-
getOverrides
Description copied from class:ContributionManagerTheContributionManagerimplementation of this method declared onIContributionManagerreturns the current overrides. If there is no overrides it lazily creates one which overrides no item state.- Specified by:
getOverridesin interfaceIContributionManager- Overrides:
getOverridesin classContributionManager- Returns:
- the overrides for the items of this manager
-
getStyle
public int getStyle()Description copied from interface:ICoolBarManagerReturns the style of the underlying cool bar widget.- Specified by:
getStylein interfaceICoolBarManager- Returns:
- the style of the cool bar
-
insertAfter
Description copied from interface:IContributionManagerInserts a contribution item for the given action after the item with the given id. Equivalent toinsertAfter(id,new ActionContributionItem(action)).- Specified by:
insertAfterin interfaceIContributionManager- Overrides:
insertAfterin classContributionManager- Parameters:
id- the contribution item idaction- the action to insert
-
insertAfter
Description copied from interface:IContributionManagerInserts a contribution item after the item with the given id.- Specified by:
insertAfterin interfaceIContributionManager- Overrides:
insertAfterin classContributionManager- Parameters:
id- the contribution item iditem- the contribution item to insert
-
insertBefore
Description copied from interface:IContributionManagerInserts a contribution item for the given action before the item with the given id. Equivalent toinsertBefore(id,new ActionContributionItem(action)).- Specified by:
insertBeforein interfaceIContributionManager- Overrides:
insertBeforein classContributionManager- Parameters:
id- the contribution item idaction- the action to insert
-
insertBefore
Description copied from interface:IContributionManagerInserts a contribution item before the item with the given id.- Specified by:
insertBeforein interfaceIContributionManager- Overrides:
insertBeforein classContributionManager- Parameters:
id- the contribution item iditem- the contribution item to insert
-
isDirty
public boolean isDirty()Description copied from interface:IContributionManagerReturns whether the list of contributions has recently changed and has yet to be reflected in the corresponding widgets.- Specified by:
isDirtyin interfaceIContributionManager- Overrides:
isDirtyin classContributionManager- Returns:
trueif this manager is dirty, andfalseif it is up-to-date
-
isEmpty
public boolean isEmpty()Description copied from interface:IContributionManagerReturns whether this manager has any contribution items.- Specified by:
isEmptyin interfaceIContributionManager- Overrides:
isEmptyin classContributionManager- Returns:
trueif there are no items, andfalseotherwise
-
markDirty
public void markDirty()Description copied from interface:IContributionManagerMarks this contribution manager as dirty.- Specified by:
markDirtyin interfaceIContributionManager- Overrides:
markDirtyin classContributionManager
-
prependToGroup
Description copied from interface:IContributionManagerAdds a contribution item for the given action at the beginning of the group with the given name. Equivalent toprependToGroup(groupName,new ActionContributionItem(action)).- Specified by:
prependToGroupin interfaceIContributionManager- Overrides:
prependToGroupin classContributionManager- Parameters:
groupName- the name of the groupaction- the action
-
prependToGroup
Description copied from interface:IContributionManagerAdds a contribution item to this manager at the beginning of the group with the given name.- Specified by:
prependToGroupin interfaceIContributionManager- Overrides:
prependToGroupin classContributionManager- Parameters:
groupName- the name of the groupitem- the contribution item
-
refresh
public void refresh()Description copied from interface:org.eclipse.jface.internal.provisional.action.ICoolBarManager2Synchronizes the visual order of the cool items in the control with this manager's internal data structures. This method should be called before requesting the order of the contribution items to ensure that the order is accurate.Note that
update()andrefresh()are converses:update()changes the visual order to match the internal structures, andrefreshchanges the internal structures to match the visual order.EXPERIMENTAL. This class or interface has been added as part of a work in progress. There is a guarantee neither that this API will work nor that it will remain the same. Please do not use this API without consulting with the Platform/UI team.
- Specified by:
refreshin interfaceorg.eclipse.jface.internal.provisional.action.ICoolBarManager2
-
remove
Description copied from interface:IContributionManagerRemoves the given contribution item from the contribution items known to this manager.- Specified by:
removein interfaceIContributionManager- Overrides:
removein classContributionManager- Parameters:
item- the contribution item- Returns:
- the
itemparameter if the item was removed, andnullif it was not found
-
remove
Description copied from interface:IContributionManagerRemoves and returns the contribution item with the given id from this manager. Returnsnullif this manager has no contribution items with the given id.- Specified by:
removein interfaceIContributionManager- Overrides:
removein classContributionManager- Parameters:
id- the contribution item id- Returns:
- the item that was found and removed, or
nullif none
-
removeAll
public void removeAll()Description copied from interface:IContributionManagerRemoves all contribution items from this manager.Note: The items will not get disposed.
- Specified by:
removeAllin interfaceIContributionManager- Overrides:
removeAllin classContributionManager
-
resetItemOrder
public void resetItemOrder()Description copied from interface:org.eclipse.jface.internal.provisional.action.ICoolBarManager2Restores the canonical order of this cool bar manager. The canonical order is the order in which the contribution items where added.EXPERIMENTAL. This class or interface has been added as part of a work in progress. There is a guarantee neither that this API will work nor that it will remain the same. Please do not use this API without consulting with the Platform/UI team.
- Specified by:
resetItemOrderin interfaceorg.eclipse.jface.internal.provisional.action.ICoolBarManager2
-
setContextMenuManager
Description copied from interface:ICoolBarManagerSets the context menu of this cool bar manager to the given menu manager.- Specified by:
setContextMenuManagerin interfaceICoolBarManager- Parameters:
menuManager- the context menu manager, ornullif none- See Also:
-
setItems
Description copied from interface:org.eclipse.jface.internal.provisional.action.ICoolBarManager2Replaces the current items with the given items. Forces an update.EXPERIMENTAL. This class or interface has been added as part of a work in progress. There is a guarantee neither that this API will work nor that it will remain the same. Please do not use this API without consulting with the Platform/UI team.
- Specified by:
setItemsin interfaceorg.eclipse.jface.internal.provisional.action.ICoolBarManager2- Parameters:
newItems- the items with which to replace the current items
-
setLockLayout
public void setLockLayout(boolean value) Description copied from interface:ICoolBarManagerLocks or unlocks the layout of the underlying cool bar widget. Once the cool bar is locked, cool items cannot be repositioned by the user.Note that items can be added or removed programmatically even while the cool bar is locked.
- Specified by:
setLockLayoutin interfaceICoolBarManager- Parameters:
value-trueto lock the cool bar,falseto unlock
-
setOverrides
Description copied from class:ContributionManagerSets the overrides for this contribution manager- Specified by:
setOverridesin interfaceorg.eclipse.jface.internal.provisional.action.ICoolBarManager2- Overrides:
setOverridesin classContributionManager- Parameters:
newOverrides- the overrides for the items of this manager
-
update
public void update(boolean force) Description copied from interface:IContributionManagerUpdates this manager's underlying widget(s) with any changes which have been made to it or its items. Normally changes to a contribution manager merely mark it as dirty, without updating the underlying widgets. This brings the underlying widgets up to date with any changes.- Specified by:
updatein interfaceIContributionManager- Parameters:
force-truemeans update even if not dirty, andfalsefor normal incremental updating
-
getTopTrim
-