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()
):
-
PreWindowOpen() - called as the window is being opened; use to configure aspects of the window other than actions bars
-
PostWindowRestore() - called after the window has been recreated from a previously saved state; use to adjust the restored window
-
PostWindowCreate() - called after the window has been created, either from an initial state or from a restored state; used to adjust the window
-
OpenIntro() - called immediately before the window is opened in order to create the introduction component, if any.
-
PostWindowOpen() - called after the window has been opened; use to hook window listeners, etc.
-
PreWindowShellClose() - called when the window's shell is closed by the user; use to pre-screen window closings
Definition at line 67 of file berryWorkbenchWindowAdvisor.h.
virtual void berry::WorkbenchWindowAdvisor::PostWindowCreate |
( |
| ) |
|
|
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.
virtual void berry::WorkbenchWindowAdvisor::PostWindowOpen |
( |
| ) |
|
|
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.
virtual void berry::WorkbenchWindowAdvisor::PreWindowOpen |
( |
| ) |
|
|
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.
virtual bool berry::WorkbenchWindowAdvisor::PreWindowShellClose |
( |
| ) |
|
|
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.
- Returns
true
to allow the window to close, and false
to prevent the window from closing
- See also
- IWorkbenchWindow::Close()
-
WorkbenchAdvisor::PreShutdown()