Medical Imaging Interaction Toolkit
2016.11.0
Medical Imaging Interaction Toolkit
|
#include <berryWorkbenchWindowAdvisor.h>
Public Member Functions | |
WorkbenchWindowAdvisor (const SmartPointer< IWorkbenchWindowConfigurer > &configurer) | |
virtual | ~WorkbenchWindowAdvisor () |
virtual void | PreWindowOpen () |
virtual SmartPointer< ActionBarAdvisor > | CreateActionBarAdvisor (SmartPointer< IActionBarConfigurer > configurer) |
virtual void | PostWindowRestore () |
virtual void | OpenIntro () |
virtual void | PostWindowCreate () |
virtual void | PostWindowOpen () |
virtual bool | PreWindowShellClose () |
virtual void | PostWindowClose () |
virtual void | CreateWindowContents (SmartPointer< Shell > shell) |
virtual QWidget * | CreateEmptyWindowContents (QWidget *parent) |
virtual bool | SaveState (SmartPointer< IMemento > memento) |
virtual bool | RestoreState (SmartPointer< IMemento > memento) |
Protected Member Functions | |
SmartPointer< IWorkbenchWindowConfigurer > | GetWindowConfigurer () |
Public base class for configuring a workbench window.
The workbench window advisor object is created in response to a workbench window being created (one per window), and is used to configure the window.
An application should declare a subclass of WorkbenchWindowAdvisor
and override methods to configure workbench windows to suit the needs of the particular application.
The following advisor methods are called at strategic points in the workbench window's lifecycle (as with the workbench advisor, all occur within the dynamic scope of the call to PlatformUI::CreateAndRunWorkbench()
):
Definition at line 69 of file berryWorkbenchWindowAdvisor.h.
berry::WorkbenchWindowAdvisor::WorkbenchWindowAdvisor | ( | const SmartPointer< IWorkbenchWindowConfigurer > & | configurer | ) |
Creates a new workbench window advisor for configuring a workbench window via the given workbench window configurer.
configurer | an object for configuring the workbench window |
Definition at line 39 of file berryWorkbenchWindowAdvisor.cpp.
References berry::SmartPointer< TObjectType >::IsNotNull().
|
virtual |
Definition at line 46 of file berryWorkbenchWindowAdvisor.cpp.
|
virtual |
Creates a new action bar advisor to configure the action bars of the window via the given action bar configurer. The default implementation returns a new instance of ActionBarAdvisor
.
configurer | the action bar configurer for the window |
Reimplemented in QmitkExtWorkbenchWindowAdvisor.
Definition at line 55 of file berryWorkbenchWindowAdvisor.cpp.
Referenced by QmitkExtWorkbenchWindowAdvisor::CreateActionBarAdvisor().
|
virtual |
Creates and returns the control to be shown when the window has no open pages. If null
is returned, the default window background is shown.
The default implementation returns null
. Subclasses may override.
parent | the parent composite |
null
Reimplemented in QmitkExtWorkbenchWindowAdvisor.
Definition at line 127 of file berryWorkbenchWindowAdvisor.cpp.
|
virtual |
Creates the contents of the window.
The default implementation adds a menu bar, a cool bar, a status line, a perspective bar, and a fast view bar. The visibility of these controls can be configured using the SetShow*
methods on IWorkbenchWindowConfigurer.
Subclasses may override to define custom window contents and layout, but must call IWorkbenchWindowConfigurer::CreatePageComposite()
.
shell | the window's shell |
Definition at line 122 of file berryWorkbenchWindowAdvisor.cpp.
References GetWindowConfigurer().
|
protected |
Returns the workbench window configurer.
Definition at line 34 of file berryWorkbenchWindowAdvisor.cpp.
Referenced by CreateWindowContents(), OpenIntro(), QmitkExtWorkbenchWindowAdvisor::PostWindowClose(), QmitkExtWorkbenchWindowAdvisor::PostWindowCreate(), QmitkExtWorkbenchWindowAdvisor::PostWindowOpen(), and QmitkExtWorkbenchWindowAdvisor::PreWindowOpen().
|
virtual |
Opens the introduction componenet.
Clients must not call this method directly (although super calls are okay). The default implementation opens the intro in the first window provided if the preference WorkbenchPreferenceConstants::SHOW_INTRO
is true
. If an intro is shown then this preference will be set to false
. Subsequently, and intro will be shown only if WorkbenchConfigurer::GetSaveAndRestore()
returns true
and the introduction was visible on last shutdown. Subclasses may override.
Definition at line 67 of file berryWorkbenchWindowAdvisor.cpp.
References berry::SmartPointer< TObjectType >::Cast(), GetWindowConfigurer(), berry::IIntroManager::HasIntro(), berry::IIntroManager::IsNewContentAvailable(), berry::WorkbenchPreferenceConstants::SHOW_INTRO, and berry::IIntroManager::ShowIntro().
|
virtual |
Performs arbitrary actions after the window is closed.
This method is called after the window's controls have been disposed. Clients must not call this method directly (although super calls are okay). The default implementation does nothing. Subclasses may override.
Reimplemented in QmitkExtWorkbenchWindowAdvisor.
Definition at line 117 of file berryWorkbenchWindowAdvisor.cpp.
|
virtual |
Performs arbitrary actions after the window has been created (possibly after being restored), but has not yet been opened.
This method is called after the window has been created from scratch, or when it has been restored from a previously-saved window. In the latter case, this method is called after PostWindowRestore()
. Clients must not call this method directly (although super calls are okay). The default implementation does nothing. Subclasses may override.
Reimplemented in QmitkExtWorkbenchWindowAdvisor.
Definition at line 101 of file berryWorkbenchWindowAdvisor.cpp.
|
virtual |
Performs arbitrary actions after the window has been opened (possibly after being restored).
This method is called after the window has been opened. This method is called after the window has been created from scratch, or when it has been restored from a previously-saved window. Clients must not call this method directly (although super calls are okay). The default implementation does nothing. Subclasses may override.
Reimplemented in QmitkExtWorkbenchWindowAdvisor.
Definition at line 106 of file berryWorkbenchWindowAdvisor.cpp.
Referenced by QmitkExtWorkbenchWindowAdvisor::PostWindowOpen().
|
virtual |
Performs arbitrary actions after the window has been restored, but before it is opened.
This method is called after a previously-saved window has been recreated. This method is not called when a new window is created from scratch. This method is never called when a workbench is started for the very first time, or when workbench state is not saved or restored. Clients must not call this method directly (although super calls are okay). The default implementation does nothing. Subclasses may override. It is okay to call IWorkbench::Close()
from this method.
WorkbenchException | thrown if there are any errors to report from post-restoration of the window |
Definition at line 62 of file berryWorkbenchWindowAdvisor.cpp.
|
virtual |
Performs arbitrary actions before the window is opened.
This method is called before the window's controls have been created. Clients must not call this method directly (although super calls are okay). The default implementation does nothing. Subclasses may override. Typical clients will use the window configurer to tweak the workbench window in an application-specific way; however, filling the window's menu bar, tool bar, and status line must be done in ActionBarAdvisor::FillActionBars()
, which is called immediately after this method is called.
Reimplemented in QmitkExtWorkbenchWindowAdvisor.
Definition at line 50 of file berryWorkbenchWindowAdvisor.cpp.
|
virtual |
Performs arbitrary actions as the window's shell is being closed directly, and possibly veto the close.
This method is called from a IShellListener
associated with the window, for example when the user clicks the window's close button. It is not called when the window is being closed for other reasons, such as if the user exits the workbench via the ActionFactory::QUIT
action. Clients must not call this method directly (although super calls are okay). If this method returns false
, then the user's request to close the shell is ignored. This gives the workbench advisor an opportunity to query the user and/or veto the closing of a window under some circumstances.
true
to allow the window to close, and false
to prevent the window from closing Definition at line 111 of file berryWorkbenchWindowAdvisor.cpp.
|
virtual |
Restores arbitrary application specific state information.
memento | the storage area for object's state |
Definition at line 138 of file berryWorkbenchWindowAdvisor.cpp.
|
virtual |
Saves arbitrary application specific state information.
memento | the storage area for object's state |
Definition at line 132 of file berryWorkbenchWindowAdvisor.cpp.