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

Quick Search    Search Deep

org.eclipse.ui.internal
Class WorkbenchConfigurer  view WorkbenchConfigurer download WorkbenchConfigurer.java

java.lang.Object
  extended byorg.eclipse.ui.internal.WorkbenchConfigurer
All Implemented Interfaces:
org.eclipse.ui.application.IWorkbenchConfigurer

public final class WorkbenchConfigurer
extends java.lang.Object
implements org.eclipse.ui.application.IWorkbenchConfigurer

Internal class providing special access for configuring the workbench.

Note that these objects are only available to the main application (the plug-in that creates and owns the workbench).

This class is not intended to be instantiated or subclassed by clients.

Since:
3.0

Field Summary
private  java.util.Map extraData
          Table to hold arbitrary key-data settings (key type: String, value type: Object).
private  boolean isEmergencyClosing
          Indicates whether the workbench is being force to close.
private  boolean saveAndRestore
          Indicates whether workbench state should be saved on close and restored on subsequent open.
 
Fields inherited from interface org.eclipse.ui.application.IWorkbenchConfigurer
RESTORE_CODE_EXIT, RESTORE_CODE_RESET
 
Constructor Summary
(package private) WorkbenchConfigurer()
          Creates a new workbench configurer.
 
Method Summary
 void declareImage(java.lang.String symbolicName, org.eclipse.jface.resource.ImageDescriptor descriptor, boolean shared)
          Declares a workbench image.
 void emergencyClose()
          Forces the workbench to close due to an emergency.
 boolean emergencyClosing()
          Returns whether the workbench is being closed due to an emergency.
 java.lang.Object getData(java.lang.String key)
          Returns the data associated with the workbench at the given key.
 boolean getSaveAndRestore()
          Returns whether the workbench state should be saved on close and restored on subsequent open.
 org.eclipse.ui.application.IWorkbenchWindowConfigurer getWindowConfigurer(org.eclipse.ui.IWorkbenchWindow window)
          Returns an object that can be used to configure the given window.
 org.eclipse.ui.IWorkbench getWorkbench()
          Returns the underlying workbench.
 org.eclipse.jface.window.WindowManager getWorkbenchWindowManager()
          Returns the workbench window manager.
 void openFirstTimeWindow()
          Opens the first time window, using the default perspective and default page input.
 org.eclipse.core.runtime.IStatus restoreState()
          Restores the workbench state saved from the previous session, if any.
 void setData(java.lang.String key, java.lang.Object data)
          Sets the data associated with the workbench at the given key.
 void setSaveAndRestore(boolean enabled)
          Sets whether the workbench state should be saved on close and restored on subsequent open.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

extraData

private java.util.Map extraData
Table to hold arbitrary key-data settings (key type: String, value type: Object).

See Also:
setData(java.lang.String, java.lang.Object) 55

saveAndRestore

private boolean saveAndRestore
Indicates whether workbench state should be saved on close and restored on subsequent open.


isEmergencyClosing

private boolean isEmergencyClosing
Indicates whether the workbench is being force to close. During an emergency close, no interaction with the user should be done.

Constructor Detail

WorkbenchConfigurer

WorkbenchConfigurer()
Creates a new workbench configurer.

This method is declared package-private. Clients are passed an instance only via WorkbenchAdvisor.initialize

Method Detail

getWorkbench

public org.eclipse.ui.IWorkbench getWorkbench()
Description copied from interface: org.eclipse.ui.application.IWorkbenchConfigurer
Returns the underlying workbench.

Specified by:
getWorkbench in interface org.eclipse.ui.application.IWorkbenchConfigurer

getWorkbenchWindowManager

public org.eclipse.jface.window.WindowManager getWorkbenchWindowManager()
Description copied from interface: org.eclipse.ui.application.IWorkbenchConfigurer
Returns the workbench window manager.

Specified by:
getWorkbenchWindowManager in interface org.eclipse.ui.application.IWorkbenchConfigurer

declareImage

public void declareImage(java.lang.String symbolicName,
                         org.eclipse.jface.resource.ImageDescriptor descriptor,
                         boolean shared)
Description copied from interface: org.eclipse.ui.application.IWorkbenchConfigurer
Declares a workbench image.

The workbench remembers the given image descriptor under the given name, and makes the image available to plug-ins via IWorkbench.getSharedImages() 55 . For "shared" images, the workbench remembers the image descriptor and will manages the image object create from it; clients retrieve "shared" images via ISharedImages.getImage() 55 . For the other, "non-shared" images, the workbench remembers only the image descriptor; clients retrieve the image descriptor via ISharedImages.getImageDescriptor() 55 and are entirely responsible for managing the image objects they create from it. (This is made confusing by the historical fact that the API interface is called "ISharedImages".)

Specified by:
declareImage in interface org.eclipse.ui.application.IWorkbenchConfigurer

getWindowConfigurer

public org.eclipse.ui.application.IWorkbenchWindowConfigurer getWindowConfigurer(org.eclipse.ui.IWorkbenchWindow window)
Description copied from interface: org.eclipse.ui.application.IWorkbenchConfigurer
Returns an object that can be used to configure the given window.

Specified by:
getWindowConfigurer in interface org.eclipse.ui.application.IWorkbenchConfigurer

getSaveAndRestore

public boolean getSaveAndRestore()
Description copied from interface: org.eclipse.ui.application.IWorkbenchConfigurer
Returns whether the workbench state should be saved on close and restored on subsequent open.

The initial value is false.

Specified by:
getSaveAndRestore in interface org.eclipse.ui.application.IWorkbenchConfigurer

setSaveAndRestore

public void setSaveAndRestore(boolean enabled)
Description copied from interface: org.eclipse.ui.application.IWorkbenchConfigurer
Sets whether the workbench state should be saved on close and restored on subsequent open.

Specified by:
setSaveAndRestore in interface org.eclipse.ui.application.IWorkbenchConfigurer

getData

public java.lang.Object getData(java.lang.String key)
Description copied from interface: org.eclipse.ui.application.IWorkbenchConfigurer
Returns the data associated with the workbench at the given key.

Specified by:
getData in interface org.eclipse.ui.application.IWorkbenchConfigurer

setData

public void setData(java.lang.String key,
                    java.lang.Object data)
Description copied from interface: org.eclipse.ui.application.IWorkbenchConfigurer
Sets the data associated with the workbench at the given key.

Specified by:
setData in interface org.eclipse.ui.application.IWorkbenchConfigurer

emergencyClose

public void emergencyClose()
Description copied from interface: org.eclipse.ui.application.IWorkbenchConfigurer
Forces the workbench to close due to an emergency. This method should only be called when the workbench is in dire straights and cannot continue, and cannot even risk a normal workbench close (think "out of memory" or "unable to create shell"). When this method is called, an abbreviated workbench shutdown sequence is performed (less critical steps may be skipped). The workbench advisor is still called; however, it must not attempt to communicate with the user. While an emergency close is in progress, emergencyClosing returns true. Workbench advisor methods should always check this flag before communicating with the user.

Specified by:
emergencyClose in interface org.eclipse.ui.application.IWorkbenchConfigurer

emergencyClosing

public boolean emergencyClosing()
Description copied from interface: org.eclipse.ui.application.IWorkbenchConfigurer
Returns whether the workbench is being closed due to an emergency. When this method returns true, the workbench is in dire straights and cannot continue. Indeed, things are so bad that we cannot even risk a normal workbench close. Workbench advisor methods should always check this flag before attempting to communicate with the user.

Specified by:
emergencyClosing in interface org.eclipse.ui.application.IWorkbenchConfigurer

restoreState

public org.eclipse.core.runtime.IStatus restoreState()
Description copied from interface: org.eclipse.ui.application.IWorkbenchConfigurer
Restores the workbench state saved from the previous session, if any. This includes any open windows and their open perspectives, open views and editors, layout information, and any customizations to the open perspectives.

This is typically called from the advisor's openWindows() method.

Specified by:
restoreState in interface org.eclipse.ui.application.IWorkbenchConfigurer

openFirstTimeWindow

public void openFirstTimeWindow()
Description copied from interface: org.eclipse.ui.application.IWorkbenchConfigurer
Opens the first time window, using the default perspective and default page input.

This is typically called from the advisor's openWindows() method.

Specified by:
openFirstTimeWindow in interface org.eclipse.ui.application.IWorkbenchConfigurer