|
Eclipse Platform Release 3.1 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface 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 interface is not intended to be implemented by clients.
WorkbenchAdvisor.initialize(org.eclipse.ui.application.IWorkbenchConfigurer)
Field Summary | |
---|---|
static int |
RESTORE_CODE_EXIT
Restore status code indicating that the saved state could not be restored, and that the application must exit immediately without modifying any previously saved workbench state. |
static int |
RESTORE_CODE_RESET
Restore status code indicating that the saved state could not be restored, but that startup should continue with a reset state. |
Method Summary | |
---|---|
void |
declareImage(String symbolicName,
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. |
Object |
getData(String key)
Returns the data associated with the workbench at the given key. |
boolean |
getExitOnLastWindowClose()
Returns true if the workbench should exit when the last
window is closed, false if the window should just be
closed, leaving the workbench (and its event loop) running.
|
boolean |
getSaveAndRestore()
Returns whether the workbench state should be saved on close and restored on subsequent open. |
IWorkbenchWindowConfigurer |
getWindowConfigurer(IWorkbenchWindow window)
Returns an object that can be used to configure the given window. |
IWorkbench |
getWorkbench()
Returns the underlying workbench. |
WindowManager |
getWorkbenchWindowManager()
Returns the workbench window manager. |
void |
openFirstTimeWindow()
Opens the first time window, using the default perspective and default page input. |
IStatus |
restoreState()
Restores the workbench state saved from the previous session, if any. |
IWorkbenchWindowConfigurer |
restoreWorkbenchWindow(IMemento memento)
Restores a workbench window from the given memento. |
void |
setData(String key,
Object data)
Sets the data associated with the workbench at the given key. |
void |
setExitOnLastWindowClose(boolean enabled)
Sets whether the workbench should exit when the last window is closed, or whether the window should just be closed, leaving the workbench (and its event loop) running. |
void |
setSaveAndRestore(boolean enabled)
Sets whether the workbench state should be saved on close and restored on subsequent open. |
Field Detail |
public static final int RESTORE_CODE_RESET
restoreState()
,
Constant Field Valuespublic static final int RESTORE_CODE_EXIT
Method Detail |
public IWorkbench getWorkbench()
public boolean getSaveAndRestore()
The initial value is false
.
true
to save and restore workbench state, or
false
to forget current workbench state on close.public void setSaveAndRestore(boolean enabled)
enabled
- true
to save and restore workbench state, or
false
to forget current workbench state on close.public IWorkbenchWindowConfigurer restoreWorkbenchWindow(IMemento memento) throws WorkbenchException
memento
- the memento from which to restore the window's state
WorkbenchException
- if an error occurred during the restoreIWorkbenchWindowConfigurer.saveState(IMemento)
public WindowManager getWorkbenchWindowManager()
public void declareImage(String symbolicName, ImageDescriptor descriptor, boolean shared)
The workbench remembers the given image descriptor under the given name,
and makes the image available to plug-ins via
IWorkbench.getSharedImages()
.
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()
.
For the other, "non-shared" images, the workbench remembers only the
image descriptor; clients retrieve the image descriptor via
ISharedImages.getImageDescriptor()
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".)
symbolicName
- the symbolic name of the imagedescriptor
- the image descriptorshared
- true
if this is a shared image, and
false
if this is not a shared imageISharedImages.getImage(java.lang.String)
,
ISharedImages.getImageDescriptor(java.lang.String)
public void emergencyClose()
emergencyClosing
returns
true
. Workbench advisor methods should always check this
flag before communicating with the user.
emergencyClosing()
public boolean emergencyClosing()
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.
true
if the workbench is in the process of being
closed under emergency conditions, and false
otherwisepublic IWorkbenchWindowConfigurer getWindowConfigurer(IWorkbenchWindow window)
window
- a workbench window
public Object getData(String key)
key
- the key
null
if there is no data at the given
keypublic void setData(String key, Object data)
key
- the keydata
- the data, or null
to delete existing datapublic IStatus restoreState()
This is typically called from the advisor's openWindows()
method.
RESTORE_CODE_RESET
,
RESTORE_CODE_EXIT
,
WorkbenchAdvisor.openWindows()
public void openFirstTimeWindow()
This is typically called from the advisor's openWindows()
method.
WorkbenchAdvisor.openWindows()
public boolean getExitOnLastWindowClose()
true
if the workbench should exit when the last
window is closed, false
if the window should just be
closed, leaving the workbench (and its event loop) running.
If true
, the last window's state is saved before closing,
so that it will be restored in the next session. This applies only if
returns
).
true
If false
, the window is simply closed, losing its state.
If the workbench is left running, it can be closed using
IWorkbench.close()
, or a new window can be opened using
IWorkbench.openWorkbenchWindow(String, IAdaptable)
.
The initial value is true
.
true
if the workbench will exit when the last
window is closed, false
if the window should just
be closedpublic void setExitOnLastWindowClose(boolean enabled)
For more details, see getExitOnLastWindowClose()
.
enabled
- true
if the workbench should exit when the last
window is closed, false
if the window should
just be closed
|
Eclipse Platform Release 3.1 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2005. All rights reserved.