Interface IWorkbenchConfigurer
- All Known Implementing Classes:
- WorkbenchConfigurer
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.
- Since:
- 3.0
- See Also:
- Restriction:
- This interface is not intended to be implemented by clients.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intRestore 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 final intRestore status code indicating that the saved state could not be restored, but that startup should continue with a reset state.
- 
Method SummaryModifier and TypeMethodDescriptionvoiddeclareImage(String symbolicName, ImageDescriptor descriptor, boolean shared) Declares a workbench image.voidForces the workbench to close due to an emergency.booleanReturns whether the workbench is being closed due to an emergency.Returns the data associated with the workbench at the given key.booleanReturnstrueif the workbench should exit when the last window is closed,falseif the window should just be closed, leaving the workbench (and its event loop) running.booleanReturns whether the workbench state should be saved on close and restored on subsequent open.getWindowConfigurer(IWorkbenchWindow window) Returns an object that can be used to configure the given window.Returns the underlying workbench.Returns the workbench window manager.voidOpens the first time window, using the default perspective and default page input.Restores the workbench state saved from the previous session, if any.restoreWorkbenchWindow(IMemento memento) Restores a workbench window from the given memento.voidSets the data associated with the workbench at the given key.voidsetExitOnLastWindowClose(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.voidsetSaveAndRestore(boolean enabled) Sets whether the workbench state should be saved on close and restored on subsequent open.
- 
Field Details- 
RESTORE_CODE_RESETstatic final int RESTORE_CODE_RESETRestore status code indicating that the saved state could not be restored, but that startup should continue with a reset state.- See Also:
 
- 
RESTORE_CODE_EXITstatic final int RESTORE_CODE_EXITRestore 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.- See Also:
 
 
- 
- 
Method Details- 
getWorkbenchIWorkbench getWorkbench()Returns the underlying workbench.- Returns:
- the workbench
 
- 
getSaveAndRestoreboolean getSaveAndRestore()Returns whether the workbench state should be saved on close and restored on subsequent open.The initial value is false.- Returns:
- trueto save and restore workbench state, or- falseto forget current workbench state on close.
 
- 
setSaveAndRestorevoid setSaveAndRestore(boolean enabled) Sets whether the workbench state should be saved on close and restored on subsequent open.- Parameters:
- enabled-- trueto save and restore workbench state, or- falseto forget current workbench state on close.
 
- 
restoreWorkbenchWindowRestores a workbench window from the given memento.- Parameters:
- memento- the memento from which to restore the window's state
- Returns:
- the configurer for the restored window
- Throws:
- WorkbenchException- if an error occurred during the restore
- Since:
- 3.1
- See Also:
 
- 
getWorkbenchWindowManagerWindowManager getWorkbenchWindowManager()Returns the workbench window manager.- Returns:
- the workbench window manager Note:IWorkbenchWindow is implemented using JFace's Window (and therefore uses WindowManager), but this is an implementation detail
 
- 
declareImageDeclares 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(). For "shared" images, the workbench remembers the image descriptor and will manages the image object create from it; clients retrieve "shared" images viaISharedImages.getImage(). For the other, "non-shared" images, the workbench remembers only the image descriptor; clients retrieve the image descriptor viaISharedImages.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".)- Parameters:
- symbolicName- the symbolic name of the image
- descriptor- the image descriptor
- shared-- trueif this is a shared image, and- falseif this is not a shared image
- See Also:
 
- 
emergencyClosevoid emergencyClose()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,emergencyClosingreturnstrue. Workbench advisor methods should always check this flag before communicating with the user.- See Also:
 
- 
emergencyClosingboolean emergencyClosing()Returns whether the workbench is being closed due to an emergency. When this method returnstrue, 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.- Returns:
- trueif the workbench is in the process of being closed under emergency conditions, and- falseotherwise
 
- 
getWindowConfigurerReturns an object that can be used to configure the given window.- Parameters:
- window- a workbench window
- Returns:
- a workbench window configurer
 
- 
getDataReturns the data associated with the workbench at the given key.- Parameters:
- key- the key
- Returns:
- the data, or nullif there is no data at the given key
 
- 
setDataSets the data associated with the workbench at the given key.- Parameters:
- key- the key
- data- the data, or- nullto delete existing data
 
- 
restoreStateIStatus restoreState()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.- Returns:
- a status object indicating whether the restore was successful
- See Also:
 
- 
openFirstTimeWindowvoid openFirstTimeWindow()Opens the first time window, using the default perspective and default page input.This is typically called from the advisor's openWindows()method.- See Also:
 
- 
getExitOnLastWindowCloseboolean getExitOnLastWindowClose()Returnstrueif the workbench should exit when the last window is closed,falseif 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 ifgetSaveAndRestore()) returnstrue.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 usingIWorkbench.openWorkbenchWindow(String, IAdaptable).The initial value is true.- Returns:
- trueif the workbench will exit when the last window is closed,- falseif the window should just be closed
- Since:
- 3.1
 
- 
setExitOnLastWindowClosevoid 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.For more details, see getExitOnLastWindowClose().- Parameters:
- enabled-- trueif the workbench should exit when the last window is closed,- falseif the window should just be closed
- Since:
- 3.1
 
 
-