Class CoolBarToTrimManager
- All Implemented Interfaces:
IContributionManager
,ICoolBarManager
,org.eclipse.jface.internal.provisional.action.ICoolBarManager2
- Since:
- 3.5
-
Field Summary
Fields inherited from interface org.eclipse.jface.action.ICoolBarManager
SIZE
-
Constructor Summary
ConstructorDescriptionCoolBarToTrimManager
(MApplication app, MTrimmedWindow window, List<MTrimElement> workbenchTrimElements, IRendererFactory rf) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds an action as a contribution item to this manager.void
add
(IContributionItem item) Adds a contribution item to this manager.void
add
(IToolBarManager toolBarManager) A convenience method to add a tool bar as a contribution item to this cool bar manager.void
appendToGroup
(String groupName, IAction action) Adds a contribution item for the given action at the end of the group with the given name.void
appendToGroup
(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.void
dispose()
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.boolean
Returns whether the layout of the underlying cool bar widget is locked.TheContributionManager
implementation of this method declared onIContributionManager
returns the current overrides.int
getStyle()
Returns the style of the underlying cool bar widget.static String
getToolbarLabel
(MApplication application, MUIElement elt) void
insertAfter
(String id, IAction action) Inserts a contribution item for the given action after the item with the given id.void
insertAfter
(String id, IContributionItem item) Inserts a contribution item after the item with the given id.void
insertBefore
(String id, IAction action) Inserts a contribution item for the given action before the item with the given id.void
insertBefore
(String id, IContributionItem item) Inserts a contribution item before the item with the given id.boolean
isDirty()
Returns whether the list of contributions has recently changed and has yet to be reflected in the corresponding widgets.boolean
isEmpty()
Returns whether this manager has any contribution items.void
Marks this contribution manager as dirty.void
prependToGroup
(String groupName, IAction action) Adds a contribution item for the given action at the beginning of the group with the given name.void
prependToGroup
(String groupName, IContributionItem item) Adds a contribution item to this manager at the beginning of the group with the given name.void
refresh()
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.void
Removes all contribution items from this manager.void
Restores the canonical order of this cool bar manager.void
setContextMenuManager
(IMenuManager menuManager) Sets the context menu of this cool bar manager to the given menu manager.void
setItems
(IContributionItem[] newItems) Replaces the current items with the given items.void
setLockLayout
(boolean value) Locks or unlocks the layout of the underlying cool bar widget.void
setOverrides
(IContributionManagerOverrides newOverrides) Sets the overrides for this contribution managervoid
update
(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:IContributionManager
Adds an action as a contribution item to this manager. Equivalent toadd(new ActionContributionItem(action))
.- Specified by:
add
in interfaceIContributionManager
- Overrides:
add
in classContributionManager
- Parameters:
action
- the action, this cannot benull
-
add
Description copied from interface:IContributionManager
Adds a contribution item to this manager.- Specified by:
add
in interfaceIContributionManager
- Overrides:
add
in classContributionManager
- Parameters:
item
- the contribution item, this cannot benull
-
getToolbarLabel
-
add
Description copied from interface:ICoolBarManager
A convenience method to add a tool bar as a contribution item to this cool bar manager. Equivalent toadd(new ToolBarContributionManager(toolBarManager))
.- Specified by:
add
in interfaceICoolBarManager
- Parameters:
toolBarManager
- the tool bar manager to be added- See Also:
-
appendToGroup
Description copied from interface:IContributionManager
Adds 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:
appendToGroup
in interfaceIContributionManager
- Overrides:
appendToGroup
in classContributionManager
- Parameters:
groupName
- the name of the groupaction
- the action
-
appendToGroup
Description copied from interface:IContributionManager
Adds a contribution item to this manager at the end of the group with the given name.- Specified by:
appendToGroup
in interfaceIContributionManager
- Overrides:
appendToGroup
in classContributionManager
- Parameters:
groupName
- the name of the groupitem
- the contribution item
-
createControl2
Description copied from interface:org.eclipse.jface.internal.provisional.action.ICoolBarManager2
Creates and returns this manager's control. Does not create a new control if one already exists.- Specified by:
createControl2
in 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.ICoolBarManager2
Disposes 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:
dispose
in interfaceorg.eclipse.jface.internal.provisional.action.ICoolBarManager2
-
find
Description copied from interface:IContributionManager
Finds the contribution item with the given id.- Specified by:
find
in interfaceIContributionManager
- Overrides:
find
in classContributionManager
- Parameters:
id
- the contribution item id- Returns:
- the contribution item, or
null
if no item with the given id can be found
-
getContextMenuManager
Description copied from interface:ICoolBarManager
Returns 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:
getContextMenuManager
in interfaceICoolBarManager
- Returns:
- the context menu manager, or
null
if none - See Also:
-
getControl2
Description copied from interface:org.eclipse.jface.internal.provisional.action.ICoolBarManager2
Returns 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:
getControl2
in interfaceorg.eclipse.jface.internal.provisional.action.ICoolBarManager2
- Returns:
- the bar control, or
null
if none
-
getItems
Description copied from interface:IContributionManager
Returns all contribution items known to this manager.- Specified by:
getItems
in interfaceIContributionManager
- Overrides:
getItems
in classContributionManager
- Returns:
- a list of contribution items
-
getLockLayout
public boolean getLockLayout()Description copied from interface:ICoolBarManager
Returns whether the layout of the underlying cool bar widget is locked.- Specified by:
getLockLayout
in interfaceICoolBarManager
- Returns:
true
if cool bar layout is locked,false
otherwise
-
getOverrides
Description copied from class:ContributionManager
TheContributionManager
implementation of this method declared onIContributionManager
returns the current overrides. If there is no overrides it lazily creates one which overrides no item state.- Specified by:
getOverrides
in interfaceIContributionManager
- Overrides:
getOverrides
in classContributionManager
- Returns:
- the overrides for the items of this manager
-
getStyle
public int getStyle()Description copied from interface:ICoolBarManager
Returns the style of the underlying cool bar widget.- Specified by:
getStyle
in interfaceICoolBarManager
- Returns:
- the style of the cool bar
-
insertAfter
Description copied from interface:IContributionManager
Inserts a contribution item for the given action after the item with the given id. Equivalent toinsertAfter(id,new ActionContributionItem(action))
.- Specified by:
insertAfter
in interfaceIContributionManager
- Overrides:
insertAfter
in classContributionManager
- Parameters:
id
- the contribution item idaction
- the action to insert
-
insertAfter
Description copied from interface:IContributionManager
Inserts a contribution item after the item with the given id.- Specified by:
insertAfter
in interfaceIContributionManager
- Overrides:
insertAfter
in classContributionManager
- Parameters:
id
- the contribution item iditem
- the contribution item to insert
-
insertBefore
Description copied from interface:IContributionManager
Inserts a contribution item for the given action before the item with the given id. Equivalent toinsertBefore(id,new ActionContributionItem(action))
.- Specified by:
insertBefore
in interfaceIContributionManager
- Overrides:
insertBefore
in classContributionManager
- Parameters:
id
- the contribution item idaction
- the action to insert
-
insertBefore
Description copied from interface:IContributionManager
Inserts a contribution item before the item with the given id.- Specified by:
insertBefore
in interfaceIContributionManager
- Overrides:
insertBefore
in classContributionManager
- Parameters:
id
- the contribution item iditem
- the contribution item to insert
-
isDirty
public boolean isDirty()Description copied from interface:IContributionManager
Returns whether the list of contributions has recently changed and has yet to be reflected in the corresponding widgets.- Specified by:
isDirty
in interfaceIContributionManager
- Overrides:
isDirty
in classContributionManager
- Returns:
true
if this manager is dirty, andfalse
if it is up-to-date
-
isEmpty
public boolean isEmpty()Description copied from interface:IContributionManager
Returns whether this manager has any contribution items.- Specified by:
isEmpty
in interfaceIContributionManager
- Overrides:
isEmpty
in classContributionManager
- Returns:
true
if there are no items, andfalse
otherwise
-
markDirty
public void markDirty()Description copied from interface:IContributionManager
Marks this contribution manager as dirty.- Specified by:
markDirty
in interfaceIContributionManager
- Overrides:
markDirty
in classContributionManager
-
prependToGroup
Description copied from interface:IContributionManager
Adds 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:
prependToGroup
in interfaceIContributionManager
- Overrides:
prependToGroup
in classContributionManager
- Parameters:
groupName
- the name of the groupaction
- the action
-
prependToGroup
Description copied from interface:IContributionManager
Adds a contribution item to this manager at the beginning of the group with the given name.- Specified by:
prependToGroup
in interfaceIContributionManager
- Overrides:
prependToGroup
in 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.ICoolBarManager2
Synchronizes 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, andrefresh
changes 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:
refresh
in interfaceorg.eclipse.jface.internal.provisional.action.ICoolBarManager2
-
remove
Description copied from interface:IContributionManager
Removes the given contribution item from the contribution items known to this manager.- Specified by:
remove
in interfaceIContributionManager
- Overrides:
remove
in classContributionManager
- Parameters:
item
- the contribution item- Returns:
- the
item
parameter if the item was removed, andnull
if it was not found
-
remove
Description copied from interface:IContributionManager
Removes and returns the contribution item with the given id from this manager. Returnsnull
if this manager has no contribution items with the given id.- Specified by:
remove
in interfaceIContributionManager
- Overrides:
remove
in classContributionManager
- Parameters:
id
- the contribution item id- Returns:
- the item that was found and removed, or
null
if none
-
removeAll
public void removeAll()Description copied from interface:IContributionManager
Removes all contribution items from this manager.Note: The items will not get disposed.
- Specified by:
removeAll
in interfaceIContributionManager
- Overrides:
removeAll
in classContributionManager
-
resetItemOrder
public void resetItemOrder()Description copied from interface:org.eclipse.jface.internal.provisional.action.ICoolBarManager2
Restores 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:
resetItemOrder
in interfaceorg.eclipse.jface.internal.provisional.action.ICoolBarManager2
-
setContextMenuManager
Description copied from interface:ICoolBarManager
Sets the context menu of this cool bar manager to the given menu manager.- Specified by:
setContextMenuManager
in interfaceICoolBarManager
- Parameters:
menuManager
- the context menu manager, ornull
if none- See Also:
-
setItems
Description copied from interface:org.eclipse.jface.internal.provisional.action.ICoolBarManager2
Replaces 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:
setItems
in 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:ICoolBarManager
Locks 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:
setLockLayout
in interfaceICoolBarManager
- Parameters:
value
-true
to lock the cool bar,false
to unlock
-
setOverrides
Description copied from class:ContributionManager
Sets the overrides for this contribution manager- Specified by:
setOverrides
in interfaceorg.eclipse.jface.internal.provisional.action.ICoolBarManager2
- Overrides:
setOverrides
in classContributionManager
- Parameters:
newOverrides
- the overrides for the items of this manager
-
update
public void update(boolean force) Description copied from interface:IContributionManager
Updates 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:
update
in interfaceIContributionManager
- Parameters:
force
-true
means update even if not dirty, andfalse
for normal incremental updating
-
getTopTrim
-