Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.eclipse.ui
Class PlatformUI  view PlatformUI download PlatformUI.java

java.lang.Object
  extended byorg.eclipse.ui.PlatformUI

public final class PlatformUI
extends java.lang.Object

The central class for access to the Eclipse Platform User Interface. This class cannot be instantiated; all functionality is provided by static methods. Features provided:


Field Summary
static java.lang.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.
 
Constructor Summary
private PlatformUI()
          Block instantiation.
 
Method Summary
static int createAndRunWorkbench(org.eclipse.swt.widgets.Display display, org.eclipse.ui.application.WorkbenchAdvisor advisor)
          Creates the workbench and associates it with the given display and workbench advisor, and runs the workbench UI.
static org.eclipse.swt.widgets.Display createDisplay()
          Creates the Display to be used by the workbench.
static org.eclipse.jface.preference.IPreferenceStore getPreferenceStore()
          Returns the preference store used for publicly settable workbench preferences.
static org.eclipse.ui.testing.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 55 has been called to create the workbench, and the workbench has yet to terminate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PLUGIN_ID

public static final java.lang.String PLUGIN_ID
Identifies the workbench plug-in.

See Also:
Constant Field Values

RETURN_OK

public static final int RETURN_OK
Return code (value 0) indicating that the workbench terminated normally.

Since:
3.0
See Also:
createAndRunWorkbench(org.eclipse.swt.widgets.Display, org.eclipse.ui.application.WorkbenchAdvisor) 55 , Constant Field Values

RETURN_RESTART

public static final int RETURN_RESTART
Return code (value 1) indicating that the workbench was terminated with a call to IWorkbench.restart.

Since:
3.0
See Also:
createAndRunWorkbench(org.eclipse.swt.widgets.Display, org.eclipse.ui.application.WorkbenchAdvisor) 55 , IWorkbench.restart() 55 , Constant Field Values

RETURN_UNSTARTABLE

public static final int RETURN_UNSTARTABLE
Return code (value 2) indicating that the workbench failed to start.

Since:
3.0
See Also:
createAndRunWorkbench(org.eclipse.swt.widgets.Display, org.eclipse.ui.application.WorkbenchAdvisor) 55 , IWorkbench.restart() 55 , Constant Field Values

RETURN_EMERGENCY_CLOSE

public static final int RETURN_EMERGENCY_CLOSE
Return code (value 3) indicating that the workbench was terminated with a call to IWorkbenchConfigurer#emergencyClose.

Since:
3.0
See Also:
createAndRunWorkbench(org.eclipse.swt.widgets.Display, org.eclipse.ui.application.WorkbenchAdvisor) 55 , Constant Field Values
Constructor Detail

PlatformUI

private PlatformUI()
Block instantiation.

Method Detail

getWorkbench

public static IWorkbench getWorkbench()
Returns the workbench. Fails if the workbench has not been created yet.


isWorkbenchRunning

public static boolean isWorkbenchRunning()
Returns whether createAndRunWorkbench 55 has been called to create the workbench, and the workbench has yet to terminate.

Since:
3.0

createAndRunWorkbench

public static int createAndRunWorkbench(org.eclipse.swt.widgets.Display display,
                                        org.eclipse.ui.application.WorkbenchAdvisor advisor)
Creates the workbench and associates it with the given display and workbench advisor, and runs the workbench UI. This entails processing and dispatching events until the workbench is closed or restarted.

This method is intended to be called by the main class (the "application"). Fails if the workbench UI has already been created.

Use createDisplay 55 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.

Since:
3.0

createDisplay

public static org.eclipse.swt.widgets.Display createDisplay()
Creates the Display to be used by the workbench. It is the caller's responsibility to dispose the resulting Display, not the workbench's.

Since:
3.0

getTestableObject

public static org.eclipse.ui.testing.TestableObject getTestableObject()
Returns the testable object facade, for use by the test harness.

IMPORTANT: This method is only for use by the test harness. Applications and regular plug-ins should not call this method.

Since:
3.0

getPreferenceStore

public static org.eclipse.jface.preference.IPreferenceStore getPreferenceStore()
Returns the preference store used for publicly settable workbench preferences. Constants for these preferences are defined on IWorkbenchPreferenceConstants.

Since:
3.0