public class ToolBarManager extends ContributionManager implements IToolBarManager
This class may be instantiated; it may also be subclassed if a more sophisticated layout is required.
Constructor and Description |
---|
ToolBarManager()
Creates a new tool bar manager with the default SWT button style.
|
ToolBarManager(int style)
Creates a tool bar manager with the given SWT button style.
|
ToolBarManager(ToolBar toolbar)
Creates a tool bar manager for an existing tool bar control.
|
Modifier and Type | Method and Description |
---|---|
ToolBar |
createControl(Composite parent)
Creates and returns this manager's tool bar control.
|
void |
dispose()
Disposes of this tool bar manager and frees all allocated SWT resources.
|
MenuManager |
getContextMenuManager()
Returns the context menu manager for this tool bar manager.
|
ToolBar |
getControl()
Returns the tool bar control for this manager.
|
protected void |
relayout(ToolBar layoutBar,
int oldCount,
int newCount)
Re-lays out the tool bar.
|
void |
setContextMenuManager(MenuManager contextMenuManager)
Sets the context menu manager for this tool bar manager to the given menu
manager.
|
void |
setStyle(int style)
Sets SWT button style for new tool bar controls created
in the
createControl(Composite) method. |
void |
update(boolean force)
Updates this manager's underlying widget(s) with any changes which
have been made to it or its items.
|
add, add, allowItem, appendToGroup, appendToGroup, dumpStatistics, find, getItems, getOverrides, getSize, hasDynamicItems, indexOf, indexOf, insert, insertAfter, insertAfter, insertBefore, insertBefore, internalSetItems, isDirty, isEmpty, itemAdded, itemRemoved, markDirty, prependToGroup, prependToGroup, remove, remove, removeAll, replaceItem, setDirty, setOverrides
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
add, add, appendToGroup, appendToGroup, find, getItems, getOverrides, insertAfter, insertAfter, insertBefore, insertBefore, isDirty, isEmpty, markDirty, prependToGroup, prependToGroup, remove, remove, removeAll
public ToolBarManager()
createControl(Composite)
method to create the tool bar control.public ToolBarManager(int style)
createControl
method to create the tool bar control.style
- the tool bar item stylefor valid style bits
public ToolBarManager(ToolBar toolbar)
ToolBar
you will not get the accessible listener provided by
JFace.toolbar
- the tool bar controlToolBarManager()
,
ToolBarManager(int)
public void setStyle(int style)
createControl(Composite)
method. It does not
affect already existing tool bar control.style
- the tool bar item stylepublic ToolBar createControl(Composite parent)
AccessibleListener
for the ToolBar
.parent
- the parent controlpublic void dispose()
removeAll
for that
purpose.public ToolBar getControl()
null
if none (before
creating or after disposal)protected void relayout(ToolBar layoutBar, int oldCount, int newCount)
The default implementation of this framework method re-lays out the parent when the number of items are different and the new count != 0
layoutBar
- the tool bar controloldCount
- the old number of itemsnewCount
- the new number of itemspublic void update(boolean force)
IContributionManager
update
in interface IContributionManager
force
- true
means update even if not dirty,
and false
for normal incremental updatingpublic MenuManager getContextMenuManager()
null
if nonepublic void setContextMenuManager(MenuManager contextMenuManager)
contextMenuManager
- the context menu manager, or null
if none
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.