|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.ui.application.WorkbenchAdvisor
za.co.bluesphere.sens.internal.ui.SENSWorkbenchAdvisor
public class SENSWorkbenchAdvisor
Public base class for configuring the workbench.
Note that the workbench advisor object is created in advance of creating the
workbench. However, by the time the workbench starts calling methods on this
class, PlatformUI.getWorkbench is guaranteed to have been
properly initialized.
Example of creating and running a workbench (in an
IPlatformRunnable):
public class MyApplication implements IPlatformRunnable {
public Object run(Object args) {
WorkbenchAdvisor workbenchAdvisor = new MyWorkbenchAdvisor();
Display display = PlatformUI.createDisplay();
int returnCode = PlatformUI.createAndRunWorkbench(display, workbenchAdvisor);
if (returnCode == PlatformUI.RETURN_RESTART) {
return IPlatformRunnable.EXIT_RESTART;
} else {
return IPlatformRunnable.EXIT_OK;
}
}
An application should declare a subclass of WorkbenchAdvisor
and override methods to configure the workbench 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):
initialize - called first; before any windows; use to
register thingspreStartup - called second; after initialize but
before first window is opened; use to temporarily disable things during
startup or restorepostStartup - called third; after first window is
opened; use to reenable things temporarily disabled in previous steppostRestore - called after the workbench and its windows
has been recreated from a previously saved state; use to adjust the
restored workbenchpreWindowOpen - called as each window is being opened;
use to configure aspects of the window other than actions bars fillActionBars - called after preWindowOpen to
configure a window's action barspostWindowRestore - called after a window has been
recreated from a previously saved state; use to adjust the restored
windowpostWindowCreate - called after a window has been created,
either from an initial state or from a restored state; used to adjust the
windowopenIntro - called immediately before a window is opened in
order to create the introduction component, if any.postWindowOpen - called after a window has been
opened; use to hook window listeners, etc.preWindowShellClose - called when a window's shell
is closed by the user; use to pre-screen window closingseventLoopException - called to handle the case where the
event loop has crashed; use to inform the user that things are not welleventLoopIdle - called when there are currently no more
events to be processed; use to perform other work or to yield until new
events enter the queuepreShutdown - called immediately prior to workbench shutdown
before any windows have been closed; allows the advisor to veto the shutdownpostShutdown - called last; after event loop has terminated
and all windows have been closed; use to deregister things registered during
initialize
| Field Summary |
|---|
| Fields inherited from class org.eclipse.ui.application.WorkbenchAdvisor |
|---|
FILL_COOL_BAR, FILL_MENU_BAR, FILL_PROXY, FILL_STATUS_LINE |
| Constructor Summary | |
|---|---|
SENSWorkbenchAdvisor()
|
|
| Method Summary | |
|---|---|
org.eclipse.ui.application.WorkbenchWindowAdvisor |
createWorkbenchWindowAdvisor(org.eclipse.ui.application.IWorkbenchWindowConfigurer configurer)
Creates a new workbench window advisor for configuring a new workbench window via the given workbench window configurer. |
java.lang.String |
getInitialWindowPerspectiveId()
Returns the id of the perspective to use for the initial workbench window, we are stating up in the diagram prespective. |
void |
initialize(org.eclipse.ui.application.IWorkbenchConfigurer configurer)
|
| Methods inherited from class org.eclipse.ui.application.WorkbenchAdvisor |
|---|
createWindowContents, eventLoopException, eventLoopIdle, fillActionBars, getDefaultPageInput, getMainPreferencePageId, getWorkbenchConfigurer, internalBasicInitialize, isApplicationMenu, openIntro, openWindows, postShutdown, postStartup, postWindowClose, postWindowCreate, postWindowOpen, postWindowRestore, preShutdown, preStartup, preWindowOpen, preWindowShellClose, restoreState, saveState |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SENSWorkbenchAdvisor()
| Method Detail |
|---|
public void initialize(org.eclipse.ui.application.IWorkbenchConfigurer configurer)
initialize in class org.eclipse.ui.application.WorkbenchAdvisorpublic java.lang.String getInitialWindowPerspectiveId()
This method is called during startup when the workbench is creating the first new window.
If the user already had a perspective from last time this method wont be called, it is only for the FIRST time the SENS aplication is run.
getInitialWindowPerspectiveId in class org.eclipse.ui.application.WorkbenchAdvisornull
if no initial perspective should be shownpublic org.eclipse.ui.application.WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(org.eclipse.ui.application.IWorkbenchWindowConfigurer configurer)
The default implementation creates a window advisor that calls back to the legacy window and action bar lifecycle methods on the workbench advisor, for backwards compatibility with 3.0.
createWorkbenchWindowAdvisor in class org.eclipse.ui.application.WorkbenchAdvisorconfigurer - the workbench window configurer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||