public final class PlatformUI extends Object
IWorkbench
Modifier and Type | Field and Description |
---|---|
static String |
PLUGIN_ID
Identifies the workbench plug-in.
|
static int |
RETURN_EMERGENCY_CLOSE
Return code (value 3) indicating that the workbench was terminated with
a call to IWorkbenchConfigurer#emergencyClose.
|
static int |
RETURN_OK
Return code (value 0) indicating that the workbench terminated normally.
|
static int |
RETURN_RESTART
Return code (value 1) indicating that the workbench was terminated with
a call to
IWorkbench.restart . |
static int |
RETURN_UNSTARTABLE
Return code (value 2) indicating that the workbench failed to start.
|
Modifier and Type | Method and Description |
---|---|
static int |
createAndRunWorkbench(Display display,
WorkbenchAdvisor advisor)
Creates the workbench and associates it with the given display and workbench
advisor, and runs the workbench UI.
|
static Display |
createDisplay()
Creates the
Display to be used by the workbench. |
static IPreferenceStore |
getPreferenceStore()
Returns the preference store used for publicly settable workbench preferences.
|
static TestableObject |
getTestableObject()
Returns the testable object facade, for use by the test harness.
|
static IWorkbench |
getWorkbench()
Returns the workbench.
|
static boolean |
isWorkbenchRunning()
Returns whether
createAndRunWorkbench has
been called to create the workbench, and the workbench has yet to
terminate. |
public static final String PLUGIN_ID
public static final int RETURN_OK
public static final int RETURN_RESTART
IWorkbench.restart
.public static final int RETURN_UNSTARTABLE
public static final int RETURN_EMERGENCY_CLOSE
public static IWorkbench getWorkbench()
public static boolean isWorkbenchRunning()
createAndRunWorkbench
has
been called to create the workbench, and the workbench has yet to
terminate.
Note that this method may return true
while the workbench
is still being initialized, so it may not be safe to call workbench API
methods even if this method returns true. See bug 49316 for details.
true
if the workbench has been created and is
still running, and false
if the workbench has not
yet been created or has completedpublic static int createAndRunWorkbench(Display display, WorkbenchAdvisor advisor)
This method is intended to be called by the main class (the "application"). Fails if the workbench UI has already been created.
Use createDisplay
to create the display to pass in.
Note that this method is intended to be called by the application
(org.eclipse.core.boot.IPlatformRunnable
). It must be
called exactly once, and early on before anyone else asks
getWorkbench()
for the workbench.
display
- the display to be used for all UI interactions with the workbenchadvisor
- the application-specific advisor that configures and
specializes the workbenchRETURN_OK
for normal exit;
RETURN_RESTART
if the workbench was terminated
with a call to IWorkbench.restart
;
RETURN_UNSTARTABLE
if the workbench could
not be started;
RETURN_EMERGENCY_CLOSE
if the UI quit
because of an emergency; other values reserved for future usepublic static Display createDisplay()
Display
to be used by the workbench.
It is the caller's responsibility to dispose the resulting Display
,
not the workbench's.public static TestableObject getTestableObject()
IMPORTANT: This method is only for use by the test harness. Applications and regular plug-ins should not call this method.
To avoid depending on the the Workbench a TestableObject
can be obtained via OSGi service.
public static IPreferenceStore getPreferenceStore()
IWorkbenchPreferenceConstants
.
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.