#include <berryActionBarAdvisor.h>
Public base class for configuring the action bars of a workbench window.
An application should declare a subclass of ActionBarAdvisor
and override methods to configure a window's action bars to suit the needs of the particular application.
The following advisor methods are called at strategic points in the workbench's lifecycle (all occur within the dynamic scope of the call to berry::PlatformUI::CreateAndRunWorkbench()):
- See also
- berry::WorkbenchWindowAdvisor::CreateActionBarAdvisor()
Definition at line 51 of file berryActionBarAdvisor.h.
◆ FillType
Enumerator |
---|
FILL_PROXY | Bit flag for FillActionBars() indicating that the operation is not filling the action bars of an actual workbench window, but rather a proxy (used for perspective customization).
|
FILL_MENU_BAR | Bit flag for FillActionBars() indicating that the operation is supposed to fill (or describe) the workbench window's menu bar.
|
FILL_TOOL_BAR | Bit flag for FillActionBars() indicating that the operation is supposed to fill (or describe) the workbench window's cool bar.
|
FILL_STATUS_LINE | Bit flag for FillActionBars() indicating that the operation is supposed to fill (or describe) the workbench window's status line.
|
Definition at line 58 of file berryActionBarAdvisor.h.
◆ ~ActionBarAdvisor()
berry::ActionBarAdvisor::~ActionBarAdvisor |
( |
| ) |
|
|
override |
◆ ActionBarAdvisor()
Creates a new action bar advisor to configure a workbench window's action bars via the given action bar configurer.
- Parameters
-
configurer | the action bar configurer |
◆ berryObjectMacro()
◆ FillActionBars()
virtual void berry::ActionBarAdvisor::FillActionBars |
( |
FillFlags |
flags | ) |
|
|
virtual |
Configures the action bars using the given action bar configurer. Under normal circumstances, flags
does not include FILL_PROXY, meaning this is a request to fill the action bars of the corresponding workbench window; the remaining flags indicate which combination of the menu bar (FILL_MENU_BAR), the tool bar (FILL_TOOL_BAR), and the status line (FILL_STATUS_LINE) are to be filled.
If flags
does include FILL_PROXY, then this is a request to describe the actions bars of the given workbench window (which will already have been filled); again, the remaining flags indicate which combination of the menu bar, the tool bar, and the status line are to be described. The actions included in the proxy action bars can be the same instances as in the actual window's action bars.
This method is called just after berry::WorkbenchWindowAdvisor::PreWindowOpen(). Clients must not call this method directly (although super calls are okay). The default implementation calls MakeActions() if FILL_PROXY is specified, then calls FillMenuBar(), FillToolBar(), and FillStatusLine() if the corresponding flags are specified.
Subclasses may override, but it is recommended that they override the methods mentioned above instead.
- Parameters
-
◆ FillMenuBar()
virtual void berry::ActionBarAdvisor::FillMenuBar |
( |
IMenuManager * |
menuBar | ) |
|
|
protectedvirtual |
Fills the menu bar with the main menus for the window.
The default implementation does nothing. Subclasses may override.
- Parameters
-
menuBar | the menu manager for the menu bar |
Reimplemented in QmitkExtActionBarAdvisor.
◆ FillStatusLine()
virtual void berry::ActionBarAdvisor::FillStatusLine |
( |
IStatusLineManager * |
statusLine | ) |
|
|
protectedvirtual |
Fills the status line with the main status line contributions for the window.
The default implementation does nothing. Subclasses may override.
- Parameters
-
statusLine | the status line manager |
◆ FillToolBar()
virtual void berry::ActionBarAdvisor::FillToolBar |
( |
IToolBarManager * |
toolBar | ) |
|
|
protectedvirtual |
Fills the tool bar with the main toolbars for the window.
The default implementation does nothing. Subclasses may override.
- Parameters
-
◆ GetAction()
virtual QAction* berry::ActionBarAdvisor::GetAction |
( |
const QString & |
id | ) |
const |
|
protectedvirtual |
Returns the action with the given id, or null
if not found.
- Parameters
-
- Returns
- the action with the given id, or
null
if not found
◆ GetActionBarConfigurer()
Returns the action bar configurer.
- Returns
- the action bar configurer
◆ MakeActions()
Instantiates the actions used in the fill methods. Use Register() to add it to the list of actions to be disposed when the window is closed.
- Parameters
-
window | the window containing the action bars |
Reimplemented in QmitkExtActionBarAdvisor.
◆ Register() [1/2]
void berry::Object::Register |
Increase the reference count (mark as used by another object).
◆ Register() [2/2]
virtual void berry::ActionBarAdvisor::Register |
( |
QAction * |
action, |
|
|
const QString & |
id |
|
) |
| |
|
protectedvirtual |
Adds the given action to the list of actions to be disposed when the window is closed.
- Parameters
-
action | the action to register, this cannot be null |
id | the unique action id |
◆ RestoreState()
Restores arbitrary application-specific state information for this action bar advisor.
The default implementation simply returns an OK status. Subclasses may extend or override.
- Parameters
-
memento | the memento from which to restore the advisor's state |
- Returns
- a status object indicating whether the restore was successful
◆ SaveState()
Saves arbitrary application-specific state information for this action bar advisor.
The default implementation simply returns an OK status. Subclasses may extend or override.
- Parameters
-
memento | the memento in which to save the advisor's state |
- Returns
- a status object indicating whether the save was successful
The documentation for this class was generated from the following file: