Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
berry::ActionBarAdvisor Class Reference

#include <berryActionBarAdvisor.h>

Inheritance diagram for berry::ActionBarAdvisor:
Collaboration diagram for berry::ActionBarAdvisor:

Public Member Functions

 berryObjectMacro (berry::ActionBarAdvisor) enum FillType
 
 ~ActionBarAdvisor ()
 
 ActionBarAdvisor (const SmartPointer< IActionBarConfigurer > &configurer)
 
virtual void FillActionBars (FillFlags flags)
 
virtual bool SaveState (SmartPointer< IMemento > memento)
 
virtual bool RestoreState (SmartPointer< IMemento > memento)
 
- Public Member Functions inherited from berry::Object
virtual QString GetClassName () const
 
virtual Reflection::TypeInfo GetTypeInfo () const
 
virtual QList< Reflection::TypeInfoGetSuperclasses () const
 
virtual void Delete ()
 
QDebug Print (QDebug os, Indent Indent=0) const
 
virtual QString ToString () const
 
virtual uint HashCode () const
 
virtual bool operator< (const Object *) const
 
void Register () const
 
void UnRegister (bool del=true) const
 
int GetReferenceCount () const
 
void SetReferenceCount (int)
 
void AddDestroyListener (const MessageAbstractDelegate<> &delegate) const
 
void RemoveDestroyListener (const MessageAbstractDelegate<> &delegate) const
 
virtual bool operator== (const Object *) const
 

Protected Member Functions

virtual SmartPointer< IActionBarConfigurerGetActionBarConfigurer () const
 
virtual void MakeActions (IWorkbenchWindow *window)
 
virtual void Register (QAction *action, const QString &id)
 
virtual QAction * GetAction (const QString &id) const
 
virtual void FillMenuBar (IMenuManager *menuBar)
 
virtual void FillToolBar (IToolBarManager *toolBar)
 
virtual void FillStatusLine (IStatusLineManager *statusLine)
 
- Protected Member Functions inherited from berry::Object
 Object ()
 
virtual ~Object ()
 
virtual QDebug PrintSelf (QDebug os, Indent indent) const
 
virtual QDebug PrintHeader (QDebug os, Indent indent) const
 
virtual QDebug PrintTrailer (QDebug os, Indent indent) const
 

Additional Inherited Members

- Public Types inherited from berry::Object
typedef Object Self
 
typedef berry::SmartPointer< SelfPointer
 
typedef berry::SmartPointer< const SelfConstPointer
 
typedef berry::WeakPointer< SelfWeakPtr
 
typedef berry::WeakPointer< const SelfConstWeakPtr
 
- Static Public Member Functions inherited from berry::Object
static const char * GetStaticClassName ()
 
static Reflection::TypeInfo GetStaticTypeInfo ()
 
static QList< Reflection::TypeInfoGetStaticSuperclasses ()
 
- Protected Attributes inherited from berry::Object
QAtomicInt m_ReferenceCount
 
QMutex m_ReferenceCountLock
 

Detailed Description

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 PlatformUI.createAndRunWorkbench):

  • fillActionBars - called after WorkbenchWindowAdvisor.preWindowOpen to configure a window's action bars
See also
WorkbenchWindowAdvisor::createActionBarAdvisor(IActionBarConfigurer)

Definition at line 55 of file berryActionBarAdvisor.h.

Constructor & Destructor Documentation

berry::ActionBarAdvisor::~ActionBarAdvisor ( )

Definition at line 29 of file berryActionBarAdvisor.cpp.

berry::ActionBarAdvisor::ActionBarAdvisor ( const SmartPointer< IActionBarConfigurer > &  configurer)

Creates a new action bar advisor to configure a workbench window's action bars via the given action bar configurer.

Parameters
configurerthe action bar configurer

Definition at line 34 of file berryActionBarAdvisor.cpp.

References berry::SmartPointer< TObjectType >::IsNotNull().

Member Function Documentation

berry::ActionBarAdvisor::berryObjectMacro ( berry::ActionBarAdvisor  )
inline

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).

Bit flag for fillActionBars indicating that the operation is supposed to fill (or describe) the workbench window's menu bar.

Bit flag for fillActionBars indicating that the operation is supposed to fill (or describe) the workbench window's cool bar.

Bit flag for fillActionBars indicating that the operation is supposed to fill (or describe) the workbench window's status line.

Definition at line 60 of file berryActionBarAdvisor.h.

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 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
flagsbit mask composed from the constants FILL_MENU_BAR, FILL_TOOL_BAR, FILL_STATUS_LINE, and FILL_PROXY

Definition at line 45 of file berryActionBarAdvisor.cpp.

References FillMenuBar(), FillToolBar(), and MakeActions().

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
menuBarthe menu manager for the menu bar

Reimplemented in QmitkExtActionBarAdvisor.

Definition at line 82 of file berryActionBarAdvisor.cpp.

Referenced by FillActionBars().

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
statusLinethe status line manager

Definition at line 92 of file berryActionBarAdvisor.cpp.

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
toolBarthe bar manager

Definition at line 87 of file berryActionBarAdvisor.cpp.

Referenced by FillActionBars().

QAction * berry::ActionBarAdvisor::GetAction ( const QString &  id) const
protectedvirtual

Returns the action with the given id, or null if not found.

Parameters
idthe action id
Returns
the action with the given id, or null if not found

Definition at line 76 of file berryActionBarAdvisor.cpp.

IActionBarConfigurer::Pointer berry::ActionBarAdvisor::GetActionBarConfigurer ( ) const
protectedvirtual

Returns the action bar configurer.

Returns
the action bar configurer

Definition at line 40 of file berryActionBarAdvisor.cpp.

void berry::ActionBarAdvisor::MakeActions ( IWorkbenchWindow window)
protectedvirtual

Instantiates the actions used in the fill methods. Use Register(QAction*) to add it to the list of actions to be disposed when the window is closed.

Parameters
windowthe window containing the action bars

Reimplemented in QmitkExtActionBarAdvisor.

Definition at line 65 of file berryActionBarAdvisor.cpp.

Referenced by FillActionBars().

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
actionthe action to register, this cannot be null
idthe unique action id

Definition at line 70 of file berryActionBarAdvisor.cpp.

bool berry::ActionBarAdvisor::RestoreState ( SmartPointer< IMemento memento)
virtual

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
mementothe memento from which to restore the advisor's state
Returns
a status object indicating whether the restore was successful

Definition at line 102 of file berryActionBarAdvisor.cpp.

bool berry::ActionBarAdvisor::SaveState ( SmartPointer< IMemento memento)
virtual

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
mementothe memento in which to save the advisor's state
Returns
a status object indicating whether the save was successful

Definition at line 97 of file berryActionBarAdvisor.cpp.


The documentation for this class was generated from the following files: