Class Workbench
- All Implemented Interfaces:
- IAdaptable,- IWorkbench,- IWorkbench,- IServiceLocator
Note that any code that is run during the creation of a workbench instance should not required access to the display.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final Stringstatic final StringFamily for the early startup job.static final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from interface org.eclipse.e4.ui.workbench.IWorkbenchAPPLICATION_CONTEXT_KEY, CLEAR_PERSISTED_STATE, CSS_RESOURCE_URI_ARG, CSS_URI_ARG, LIFE_CYCLE_URI_ARG, MODEL_RESOURCE_HANDLER, ON_TOP, PERSIST_STATE, PRESENTATION_URI_ARG, XMI_URI_ARG
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddShowingMenus(Set menuIds, ISelection localSelection, ISelection localEditorInput) Adds the ids of a menu that is now showing to the menu source provider.voidAdds a window listener.voidaddWorkbenchListener(IWorkbenchListener listener) Adds a workbench listener.booleanclose()Closes this workbench and all its open windows.static intcreateAndRunWorkbench(Display display, WorkbenchAdvisor advisor) Creates the workbench and associates it with the the given display and workbench advisor, and runs the workbench UI.static DisplayCreates theDisplayto be used by the workbench.protected StringcreateId()Creates a new local working set manager.protected voidfireWindowActivated(IWorkbenchWindow window) Fire window activated event.protected voidfireWindowClosed(IWorkbenchWindow window) Fire window closed event.protected voidFire window deactivated event.protected voidfireWindowOpened(IWorkbenchWindow window) Fire window opened event.Returns the currently active window for this workbench (if any).Returns an interface to manage activities at the workbench level.<T> TgetAdapter(Class<T> key) Returns an object which is an instance of the given class associated with this object.Return the browser support for this workbench.Returns an interface to manage contexts at the workbench level.Returns the decorator manager.Returns the default workbench window page input.Returns the default perspective id, which may benull.String[]Returns the ids of the early activated plug-ins that have been disabled by the user.Returns the display for this workbench.Returns the ids of all plug-ins that extend theorg.eclipse.ui.startupextension point.Returns the editor registry for the workbench.getElementFactory(String factoryId) Returns the element factory with the given id.Return the export wizard registry.Return the extension tracker for the workbench.Return the help system for this workbench.getId()Return the import wizard registry.static WorkbenchReturns the one and only instance of the workbench, if there is one.org.eclipse.ui.internal.intro.IntroDescriptorReturn the intro manager for this workbench.Returns the id of the preference page that should be presented most prominently.Return a shell provider that can be used to get the best parenting possible for a modal dialog.Return the new wizard registry.Returns the undoable operation support for the workbench.Returns the perspective registry for the workbench.Returns the preference manager for the workbench.Returns the preference store for the workbench.Returns the progress service for the workbench.<T> TgetService(Class<T> key) Retrieves the service corresponding to the given API.Returns the shared images for the workbench.Return the theme manager for this workbench.Returns the view registry for the workbench.static org.eclipse.ui.internal.testing.WorkbenchTestableReturns the testable object facade, for use by the test harness.intReturns the number of open main windows associated with this workbench.Returns a list of the open main windows associated with this workbench.Returns the working set manager for the workbench.booleanhasService(Class<?> key) Whether this service exists within the scope of this service locator.booleanReturns a boolean indicating whether the workbench is in the process of closing.booleanReturnstrueif the workbench is running,falseif it has been terminated.booleanReturns true if the Workbench is in the process of starting.voidIndicates the end of a large update within the workbench.voidIndicates the start of a large update within the workbench.openWorkbenchWindow(String perspectiveId, IAdaptable input) Creates and opens a new workbench window with one page.openWorkbenchWindow(IAdaptable input) Creates and opens a new workbench window with one page.openWorkbenchWindow(IAdaptable input, IPerspectiveDescriptor descriptor, MWindow window, boolean newWindow) voidregisterService(Class api, Object service) Registers a service with this locator.voidremoveShowingMenus(Set menuIds, ISelection localSelection, ISelection localEditorInput) Removes the ids of a menu that is now hidden from the menu source provider.voidRemoves a window listener.voidremoveWorkbenchListener(IWorkbenchListener listener) Removes a workbench listener.booleanrestart()Closes then restarts the workbench with the same command line as used for the previous launch.booleanrestart(boolean useCurrrentWorkspace) Closes then restarts this workbench using the current workspace ifuseCurrentWorkspaceistrue.booleansaveAll(IShellProvider shellProvider, IRunnableContext runnableContext, ISaveableFilter filter, boolean confirm) Save all dirty saveables in the workbench that match the given filter.booleansaveAllEditors(boolean confirm) Save all dirty editors in the workbench.voidsetEnableAutoSave(boolean b) Disable the Workbench Auto-Save job on startup during tests.voidsetIntroDescriptor(org.eclipse.ui.internal.intro.IntroDescriptor descriptor) This method exists as a test hook.static ObjectsetRestartArguments(String workspacePath) Sets the arguments required to restart the workbench using the specified path as the workspace location.showPerspective(String perspectiveId, IWorkbenchWindow window) Shows the specified perspective to the user.showPerspective(String perspectiveId, IWorkbenchWindow targetWindow, IAdaptable input) Shows the specified perspective to the user.Methods inherited from class org.eclipse.core.commands.common.EventManageraddListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
- 
Field Details- 
WORKBENCH_AUTO_SAVE_JOB- See Also:
 
- 
MEMENTO_KEY- See Also:
 
- 
EDITOR_TAG- See Also:
 
- 
PROP_EXIT_CODE- See Also:
 
- 
EARLY_STARTUP_FAMILYFamily for the early startup job.- See Also:
 
- 
DEFAULT_WORKBENCH_STATE_FILENAME- See Also:
 
 
- 
- 
Method Details- 
getInstanceReturns the one and only instance of the workbench, if there is one.- Returns:
- the workbench, or nullif the workbench has not been created, or has been created and already completed
 
- 
createAndRunWorkbenchCreates the workbench and associates it with the 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 PlatformUI. Fails if the workbench UI has already been created.The display passed in must be the default display. - Parameters:
- display- the display to be used for all UI interactions with the workbench
- advisor- the application-specific advisor that configures and specializes the workbench
- Returns:
- return code RETURN_OKfor normal exit;RETURN_RESTARTif the workbench was terminated with a call toIWorkbench.restart; other values reserved for future use
 
- 
createDisplayCreates theDisplayto be used by the workbench.- Returns:
- the display
 
- 
getWorkbenchTestablepublic static org.eclipse.ui.internal.testing.WorkbenchTestable getWorkbenchTestable()Returns the testable object facade, for use by the test harness.- Returns:
- the testable object facade
- Since:
- 3.0
 
- 
addWorkbenchListenerDescription copied from interface:IWorkbenchAdds a workbench listener.- Specified by:
- addWorkbenchListenerin interface- IWorkbench
- Parameters:
- listener- the workbench listener to add
 
- 
removeWorkbenchListenerDescription copied from interface:IWorkbenchRemoves a workbench listener.- Specified by:
- removeWorkbenchListenerin interface- IWorkbench
- Parameters:
- listener- the workbench listener to remove
 
- 
addWindowListenerDescription copied from interface:IWorkbenchAdds a window listener.- Specified by:
- addWindowListenerin interface- IWorkbench
- Parameters:
- l- the window listener to add
 
- 
removeWindowListenerDescription copied from interface:IWorkbenchRemoves a window listener.- Specified by:
- removeWindowListenerin interface- IWorkbench
- Parameters:
- l- the window listener to remove
 
- 
fireWindowOpenedFire window opened event.- Parameters:
- window- The window which just opened; should not be- null.
 
- 
fireWindowClosedFire window closed event.- Parameters:
- window- The window which just closed; should not be- null.
 
- 
fireWindowActivatedFire window activated event.- Parameters:
- window- The window which was just activated; should not be- null.
 
- 
fireWindowDeactivatedFire window deactivated event.- Parameters:
- window- The window which was just deactivated; should not be- null.
 
- 
saveAllEditorspublic boolean saveAllEditors(boolean confirm) Description copied from interface:IWorkbenchSave all dirty editors in the workbench. Opens a dialog to prompt the user ifconfirmis true. Return true if successful. Return false if the user has canceled the command.- Specified by:
- saveAllEditorsin interface- IWorkbench
- Parameters:
- confirm-- trueto ask the user before saving unsaved changes (recommended), and- falseto save unsaved changes without asking
- Returns:
- trueif the command succeeded, and- falseif the operation was canceled by the user or an error occurred while saving
 
- 
closepublic boolean close()Description copied from interface:IWorkbenchCloses this workbench and all its open windows.If the workbench has an open editor with unsaved content, the user will be given the opportunity to save it. - Specified by:
- closein interface- IWorkbench
- Specified by:
- closein interface- IWorkbench
- Returns:
- trueif the workbench was successfully closed, and- falseif it is still open
 
- 
getActiveWorkbenchWindowDescription copied from interface:IWorkbenchReturns the currently active window for this workbench (if any). Returnsnullif there is no active workbench window. Returnsnullif called from a non-UI thread.In the special case when there's no active workbench window and a workbench window is under construction this workbench window instance is returned. - Specified by:
- getActiveWorkbenchWindowin interface- IWorkbench
- Returns:
- the active workbench window, or nullif there is no active workbench window or if called from a non-UI thread
 
- 
getEditorHistory
- 
getEditorRegistryDescription copied from interface:IWorkbenchReturns the editor registry for the workbench.- Specified by:
- getEditorRegistryin interface- IWorkbench
- Returns:
- the workbench editor registry
 
- 
getOperationSupportDescription copied from interface:IWorkbenchReturns the undoable operation support for the workbench. - Specified by:
- getOperationSupportin interface- IWorkbench
- Returns:
- the workbench operation support
 
- 
getPerspectiveRegistryDescription copied from interface:IWorkbenchReturns the perspective registry for the workbench.- Specified by:
- getPerspectiveRegistryin interface- IWorkbench
- Returns:
- the workbench perspective registry
 
- 
getPreferenceManagerDescription copied from interface:IWorkbenchReturns the preference manager for the workbench.- Specified by:
- getPreferenceManagerin interface- IWorkbench
- Returns:
- the workbench preference manager
 
- 
getPreferenceStoreDescription copied from interface:IWorkbenchReturns the preference store for the workbench.- Specified by:
- getPreferenceStorein interface- IWorkbench
- Returns:
- the workbench preference store
 
- 
getWorkbenchWindowCountpublic int getWorkbenchWindowCount()Description copied from interface:IWorkbenchReturns the number of open main windows associated with this workbench. Note that wizards and dialogs are not included in this list since they are not considered main windows.- Specified by:
- getWorkbenchWindowCountin interface- IWorkbench
- Returns:
- the number of open windows
 
- 
getWorkbenchWindowsDescription copied from interface:IWorkbenchReturns a list of the open main windows associated with this workbench. Note that wizards and dialogs are not included in this list since they are not considered main windows.- Specified by:
- getWorkbenchWindowsin interface- IWorkbench
- Returns:
- a list of open windows
 
- 
getWorkingSetManagerDescription copied from interface:IWorkbenchReturns the working set manager for the workbench.- Specified by:
- getWorkingSetManagerin interface- IWorkbench
- Returns:
- the working set manager
 
- 
createLocalWorkingSetManagerDescription copied from interface:IWorkbenchCreates a new local working set manager. Clients of local working set managers are responsible for callingIWorkingSetManager.dispose()when the working sets it manages are no longer needed.- Specified by:
- createLocalWorkingSetManagerin interface- IWorkbench
- Returns:
- the local working set manager
 
- 
isClosingpublic boolean isClosing()Description copied from interface:IWorkbenchReturns a boolean indicating whether the workbench is in the process of closing.- Specified by:
- isClosingin interface- IWorkbench
- Returns:
- trueif the workbench is in the process of closing,- falseotherwise
 
- 
getBindingContext
- 
isStartingpublic boolean isStarting()Returns true if the Workbench is in the process of starting.- Specified by:
- isStartingin interface- IWorkbench
- Returns:
- trueif the Workbench is starting, but not yet running the event loop.
 
- 
openWorkbenchWindowDescription copied from interface:IWorkbenchCreates and opens a new workbench window with one page. The perspective of the new page is defined by the default perspective ID. The new window and new page become active.Note: The caller is responsible to ensure the action using this method will explicitly inform the user a new window will be opened. Otherwise, callers are strongly recommended to use the openPerspectiveAPIs to programmatically show a perspective to avoid confusing the user.- Specified by:
- openWorkbenchWindowin interface- IWorkbench
- Parameters:
- input- the page input, or- nullif there is no current input. This is used to seed the input for the new page's views.
- Returns:
- the new workbench window
- Throws:
- WorkbenchException- if a new window and page could not be opened
- See Also:
 
- 
openWorkbenchWindowpublic IWorkbenchWindow openWorkbenchWindow(String perspectiveId, IAdaptable input) throws WorkbenchException Description copied from interface:IWorkbenchCreates and opens a new workbench window with one page. The perspective of the new page is defined by the specified perspective ID. The new window and new page become active.Note: The caller is responsible to ensure the action using this method will explicitly inform the user a new window will be opened. Otherwise, callers are strongly recommended to use the openPerspectiveAPIs to programmatically show a perspective to avoid confusing the user.In most cases where this method is used the caller is tightly coupled to a particular perspective. They define it in the registry and contribute some user interface action to open or activate it. In situations like this a static variable is often used to identify the perspective ID. - Specified by:
- openWorkbenchWindowin interface- IWorkbench
- Parameters:
- perspectiveId- the perspective id for the window's initial page, or- nullfor no initial page
- input- the page input, or- nullif there is no current input. This is used to seed the input for the new page's views.
- Returns:
- the new workbench window
- Throws:
- WorkbenchException- if a new window and page could not be opened
- See Also:
 
- 
openWorkbenchWindowpublic WorkbenchWindow openWorkbenchWindow(IAdaptable input, IPerspectiveDescriptor descriptor, MWindow window, boolean newWindow) 
- 
restartpublic boolean restart()Description copied from interface:IWorkbenchCloses then restarts the workbench with the same command line as used for the previous launch.If the workbench has an open editor with unsaved content, the user will be given the opportunity to save it. - Specified by:
- restartin interface- IWorkbench
- Specified by:
- restartin interface- IWorkbench
- Returns:
- trueif the workbench was successfully closed, and- falseif it could not be closed
 
- 
restartpublic boolean restart(boolean useCurrrentWorkspace) Description copied from interface:IWorkbenchCloses then restarts this workbench using the current workspace ifuseCurrentWorkspaceistrue. Otherwise, works asIWorkbench.restart().If the workbench has an open editor with unsaved content, the user will be given the opportunity to save it. - Specified by:
- restartin interface- IWorkbench
- Parameters:
- useCurrrentWorkspace-- trueto use the current workspace while restarting this workbench, and- falseto restart the workbench with the same command line as used for the previous launch
- Returns:
- trueif the workbench was successfully closed, and- falseif it could not be closed
 
- 
setRestartArgumentsSets the arguments required to restart the workbench using the specified path as the workspace location.- Parameters:
- workspacePath- the new workspace location
- Returns:
- IApplication.EXIT_OKor- IApplication.EXIT_RELAUNCH
 
- 
getEarlyActivatedPluginsReturns the ids of all plug-ins that extend theorg.eclipse.ui.startupextension point.- Returns:
- the ids of all plug-ins containing 1 or more startup extensions
 
- 
getDisabledEarlyActivatedPluginsReturns the ids of the early activated plug-ins that have been disabled by the user.- Returns:
- the ids of the early activated plug-ins that have been disabled by the user
 
- 
setEnableAutoSavepublic void setEnableAutoSave(boolean b) Disable the Workbench Auto-Save job on startup during tests.- Parameters:
- b-- falseto disable the tests.
 
- 
showPerspectivepublic IWorkbenchPage showPerspective(String perspectiveId, IWorkbenchWindow window) throws WorkbenchException Description copied from interface:IWorkbenchShows the specified perspective to the user. The caller should use this method when the perspective to be shown is not dependent on the page's input. That is, the perspective can open in any page depending on user preferences.The perspective may be shown in the specified window, in another existing window, or in a new window depending on user preferences. The exact policy is controlled by the workbench to ensure consistency to the user. The policy is subject to change. The current policy is as follows: - If the specified window has the requested perspective open, then the window is given focus and the perspective is shown. The page's input is ignored.
- If another window that has the workspace root as input and the requested perspective open and active, then the window is given focus.
- Otherwise the requested perspective is opened and shown in the specified window or in a new window depending on the current user preference for opening perspectives, and that window is given focus.
 The workbench also defines a number of menu items to activate or open each registered perspective. A complete list of these perspectives is available from the perspective registry found on IWorkbench.- Specified by:
- showPerspectivein interface- IWorkbench
- Parameters:
- perspectiveId- the perspective ID to show
- window- the workbench window of the action calling this method.
- Returns:
- the workbench page that the perspective was shown
- Throws:
- WorkbenchException- if the perspective could not be shown
 
- 
showPerspectivepublic IWorkbenchPage showPerspective(String perspectiveId, IWorkbenchWindow targetWindow, IAdaptable input) throws WorkbenchException Description copied from interface:IWorkbenchShows the specified perspective to the user. The caller should use this method when the perspective to be shown is dependent on the page's input. That is, the perspective can only open in any page with the specified input.The perspective may be shown in the specified window, in another existing window, or in a new window depending on user preferences. The exact policy is controlled by the workbench to ensure consistency to the user. The policy is subject to change. The current policy is as follows: - If the specified window has the requested perspective open and the same requested input, then the window is given focus and the perspective is shown.
- If another window has the requested input and the requested perspective open and active, then that window is given focus.
- If the specified window has the same requested input but not the requested perspective, then the window is given focus and the perspective is opened and shown on condition that the user preference is not to open perspectives in a new window.
- Otherwise the requested perspective is opened and shown in a new window, and the window is given focus.
 The workbench also defines a number of menu items to activate or open each registered perspective. A complete list of these perspectives is available from the perspective registry found on IWorkbench.- Specified by:
- showPerspectivein interface- IWorkbench
- Parameters:
- perspectiveId- the perspective ID to show
- targetWindow- the workbench window of the action calling this method.
- input- the page input, or- nullif there is no current input. This is used to seed the input for the page's views
- Returns:
- the workbench page that the perspective was shown
- Throws:
- WorkbenchException- if the perspective could not be shown
 
- 
getDecoratorManagerDescription copied from interface:IWorkbenchReturns the decorator manager.Any client using the decorator manager should come up with the text and image for the element (including any of the part's own decorations) before calling the decorator manager. It should also add a listener to be notified when decorations change. Note that if the element implements IAdaptable, decorators may use this mechanism to obtain an adapter (for example anIResource), and derive the decoration from the adapter rather than the element. Since the adapter may differ from the original element, those using the decorator manager should be prepared to handle notification that the decoration for the adapter has changed, in addition to handling notification that the decoration for the element has changed. That is, it needs to be able to map back from the adapter to the element.- Specified by:
- getDecoratorManagerin interface- IWorkbench
- Returns:
- the decorator manager
 
- 
getDisplayDescription copied from interface:IWorkbenchReturns the display for this workbench.Code should always ask the workbench for the display rather than rely on Display.getDefault().- Specified by:
- getDisplayin interface- IWorkbench
- Returns:
- the display to be used for all UI interactions with this workbench
 
- 
getDefaultPerspectiveIdReturns the default perspective id, which may benull.- Returns:
- the default perspective id, or null
 
- 
getDefaultPageInputReturns the default workbench window page input.- Returns:
- the default window page input or nullif none
 
- 
getMainPreferencePageIdReturns the id of the preference page that should be presented most prominently.- Returns:
- the id of the preference page, or nullif none
 
- 
getElementFactoryDescription copied from interface:IWorkbenchReturns the element factory with the given id.- Specified by:
- getElementFactoryin interface- IWorkbench
- Parameters:
- factoryId- the id of the element factory
- Returns:
- the element factory, or nullif none
- See Also:
 
- 
getProgressServiceDescription copied from interface:IWorkbenchReturns the progress service for the workbench.- Specified by:
- getProgressServicein interface- IWorkbench
- Returns:
- the progress service
 
- 
getActivitySupportDescription copied from interface:IWorkbenchReturns an interface to manage activities at the workbench level.- Specified by:
- getActivitySupportin interface- IWorkbench
- Returns:
- an interface to manage activities at the workbench level. Guaranteed
         not to be null.
 
- 
getContextSupportDescription copied from interface:IWorkbenchReturns an interface to manage contexts at the workbench level.- Specified by:
- getContextSupportin interface- IWorkbench
- Returns:
- an interface to manage contexts at the workbench level. Guaranteed
         not to be null.
- See Also:
 
- 
getIntroManagerDescription copied from interface:IWorkbenchReturn the intro manager for this workbench.- Specified by:
- getIntroManagerin interface- IWorkbench
- Returns:
- the intro manager for this workbench. Guaranteed not to be
         null.
 
- 
getIntroDescriptorpublic org.eclipse.ui.internal.intro.IntroDescriptor getIntroDescriptor()- Returns:
- the intro extension for this workbench.
- Since:
- 3.0
 
- 
setIntroDescriptorpublic void setIntroDescriptor(org.eclipse.ui.internal.intro.IntroDescriptor descriptor) This method exists as a test hook. This method should NEVER be called by clients.- Parameters:
- descriptor- The intro descriptor to use.
- Since:
- 3.0
 
- 
getThemeManagerDescription copied from interface:IWorkbenchReturn the theme manager for this workbench.- Specified by:
- getThemeManagerin interface- IWorkbench
- Returns:
- the theme manager for this workbench.Guaranteed not to be
         null.
 
- 
isRunningpublic boolean isRunning()Returnstrueif the workbench is running,falseif it has been terminated.- Returns:
- trueif the workbench is running,- falseif it has been terminated.
 
- 
largeUpdateStartpublic void largeUpdateStart()Indicates the start of a large update within the workbench. This is used to disable CPU-intensive, change-sensitive services that were temporarily disabled in the midst of large changes. This method should always be called in tandem with largeUpdateEnd, and the event loop should not be allowed to spin before that method is called.Important: always use with largeUpdateEnd!
- 
largeUpdateEndpublic void largeUpdateEnd()Indicates the end of a large update within the workbench. This is used to re-enable services that were temporarily disabled in the midst of large changes. This method should always be called in tandem with largeUpdateStart, and the event loop should not be allowed to spin before this method is called.Important: always protect this call by using finally!
- 
getExtensionTrackerDescription copied from interface:IWorkbenchReturn the extension tracker for the workbench. This tracker may be used by plug-ins to ensure responsiveness to changes to the plug-in registry. The tracker at this level of the workbench is typically used to track elements that persist for the life of the workbench. For example, IEditorDescriptorobjects fall into this category.- Specified by:
- getExtensionTrackerin interface- IWorkbench
- Returns:
- the extension tracker
- See Also:
 
- 
getHelpSystemDescription copied from interface:IWorkbenchReturn the help system for this workbench.- Specified by:
- getHelpSystemin interface- IWorkbench
- Returns:
- the help system
 
- 
getBrowserSupportDescription copied from interface:IWorkbenchReturn the browser support for this workbench.- Specified by:
- getBrowserSupportin interface- IWorkbench
- Returns:
- the browser support system
 
- 
getViewRegistryDescription copied from interface:IWorkbenchReturns the view registry for the workbench.- Specified by:
- getViewRegistryin interface- IWorkbench
- Returns:
- the workbench view registry
 
- 
getNewWizardRegistryDescription copied from interface:IWorkbenchReturn the new wizard registry.- Specified by:
- getNewWizardRegistryin interface- IWorkbench
- Returns:
- the new wizard registry
 
- 
getImportWizardRegistryDescription copied from interface:IWorkbenchReturn the import wizard registry.- Specified by:
- getImportWizardRegistryin interface- IWorkbench
- Returns:
- the import wizard registry
 
- 
getExportWizardRegistryDescription copied from interface:IWorkbenchReturn the export wizard registry.- Specified by:
- getExportWizardRegistryin interface- IWorkbench
- Returns:
- the export wizard registry
 
- 
getAdapterDescription copied from interface:IAdaptableReturns an object which is an instance of the given class associated with this object. Returnsnullif no such object can be found.Clients may implement this method but should generally call Adapters.adapt(Object, Class, boolean)rather than invoking it directly.- Specified by:
- getAdapterin interface- IAdaptable
- Type Parameters:
- T- the class type
- Parameters:
- key- the adapter class to look up
- Returns:
- a object of the given class, or nullif this object does not have an adapter for the given class
 
- 
getServiceDescription copied from interface:IServiceLocatorRetrieves the service corresponding to the given API.- Specified by:
- getServicein interface- IServiceLocator
- Parameters:
- key- This is the interface that the service implements. Must not be- null.
- Returns:
- The service, or nullif no such service could be found.
 
- 
hasServiceDescription copied from interface:IServiceLocatorWhether this service exists within the scope of this service locator. This does not include looking for the service within the scope of the parents. This method can be used to determine whether a particular service supports nesting in this scope.- Specified by:
- hasServicein interface- IServiceLocator
- Parameters:
- key- This is the interface that the service implements. Must not be- null.
- Returns:
- trueif the service locator can find a service for the given API;- falseotherwise.
 
- 
registerServiceRegisters a service with this locator. If there is an existing service matching the sameapiand it implementsIDisposable, it will be disposed.- Parameters:
- api- This is the interface that the service implements. Must not be- null.
- service- The service to register. This must be some implementation of- api. This value must not be- null.
 
- 
addShowingMenusAdds the ids of a menu that is now showing to the menu source provider. This is used for legacy action-based handlers which need to become active only for the duration of a menu being visible.- Parameters:
- menuIds- The identifiers of the menu that is now showing; must not be- null.
 
- 
removeShowingMenusRemoves the ids of a menu that is now hidden from the menu source provider. This is used for legacy action-based handlers which need to become active only for the duration of a menu being visible.- Parameters:
- menuIds- The identifiers of the menu that is now hidden; must not be- null.
 
- 
saveAllpublic boolean saveAll(IShellProvider shellProvider, IRunnableContext runnableContext, ISaveableFilter filter, boolean confirm) Description copied from interface:IWorkbenchSave all dirty saveables in the workbench that match the given filter. Opens a dialog to prompt the user ifconfirmis true. Return true if successful. Return false if the user has canceled the command.- Specified by:
- saveAllin interface- IWorkbench
- Parameters:
- shellProvider- the provider used to obtain a shell in prompting is required. Clients can use a workbench window for this.
- runnableContext- a runnable context that will be used to provide a progress monitor while the save is taking place. Clients can use a workbench window for this.
- filter- the filter used to determine if a particular dirty saveable needs to be saved or- nullif all dirty saveables should be saved.
- confirm-- trueto ask the user before saving unsaved changes (recommended), and- falseto save unsaved changes without asking
- Returns:
- trueif the command succeeded, and- falseif the operation was canceled by the user or an error occurred while saving
 
- 
getModalDialogShellProviderDescription copied from interface:IWorkbenchReturn a shell provider that can be used to get the best parenting possible for a modal dialog. If modal shells are already created, use the topmost modal shell as the parent to avoid two modal dialogs. If there are no modal shells, use the shell of the active workbench window.- Specified by:
- getModalDialogShellProviderin interface- IWorkbench
- Returns:
- a shell provider that provides the best parenting possible for a modal dialog.
 
- 
getContext
- 
getApplication- Specified by:
- getApplicationin interface- IWorkbench
- Returns:
- the application model driving the workbench
 
- 
getId- Specified by:
- getIdin interface- IWorkbench
- Returns:
- unique id of the instance
 
- 
createId
 
-