| org.eclipse.ui.IWorkbench
All known Subclasses: org.eclipse.ui.internal.Workbench,
IWorkbench | public interface IWorkbench extends IAdaptable,IServiceLocator(Code) | | A workbench is the root object for the Eclipse Platform user interface.
A workbench has one or more main windows which present to the end
user information based on some underlying model, typically on resources in an
underlying workspace. A workbench usually starts with a single open window,
and automatically closes when its last window closes.
Each workbench window has a collection of pages; the active
page is the one that is being presented to the end user; at most one page is
active in a window at a time.
Each workbench page has a collection of workbench parts, of which
there are two kinds: views and editors. A page's parts are arranged (tiled or
stacked) for presentation on the screen. The arrangement is not fixed; the
user can arrange the parts as they see fit. A perspective is a
template for a page, capturing a collection of parts and their arrangement.
The platform creates a workbench when the workbench plug-in is activated;
since this happens at most once during the life of the running platform,
there is only one workbench instance. Due to its singular nature, it is
commonly referred to as the workbench.
The workbench supports a few
IServiceLocator services by default. If
these services are used to allocate resources, it is important to remember to
clean up those resources after you are done with them. Otherwise, the
resources will exist until the workbench shuts down. The supported services
are:
This interface is not intended to be implemented by clients.
See Also: org.eclipse.ui.PlatformUI.getWorkbench |
addWindowListener | public void addWindowListener(IWindowListener listener)(Code) | | Adds a window listener.
Parameters: listener - the window listener to add since: 2.0 |
addWorkbenchListener | public void addWorkbenchListener(IWorkbenchListener listener)(Code) | | Adds a workbench listener.
Parameters: listener - the workbench listener to add since: 3.2 |
close | public boolean close()(Code) | | Closes 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.
true if the workbench was successfully closed, andfalse if it is still open |
createLocalWorkingSetManager | public ILocalWorkingSetManager createLocalWorkingSetManager()(Code) | | Creates a new local working set manager. Clients of local working set
managers are responsible for calling
IWorkingSetManager.dispose when the working sets it manages are no longer needed.
the local working set manager since: 3.1 |
getActiveWorkbenchWindow | public IWorkbenchWindow getActiveWorkbenchWindow()(Code) | | Returns the currently active window for this workbench (if any). Returns
null if there is no active workbench window. Returns
null if called from a non-UI thread.
the active workbench window, or null if there isno active workbench window or if called from a non-UI thread |
getActivitySupport | IWorkbenchActivitySupport getActivitySupport()(Code) | | Returns an interface to manage activities at the workbench level.
an interface to manage activities at the workbench level.Guaranteed not to be null . since: 3.0 |
getBrowserSupport | public IWorkbenchBrowserSupport getBrowserSupport()(Code) | | Return the browser support for this workbench.
the browser support system since: 3.1 |
getDecoratorManager | public IDecoratorManager getDecoratorManager()(Code) | | Returns 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 an
IResource ), 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.
the decorator manager |
getDisplay | public Display getDisplay()(Code) | | Returns the display for this workbench.
Code should always ask the workbench for the display rather than rely on
Display.getDefault Display.getDefault() .
the display to be used for all UI interactions with thisworkbench since: 3.0 |
getEditorRegistry | public IEditorRegistry getEditorRegistry()(Code) | | Returns the editor registry for the workbench.
the workbench editor registry |
getElementFactory | public IElementFactory getElementFactory(String factoryId)(Code) | | Returns the element factory with the given id.
Parameters: factoryId - the id of the element factory the element factory, or null if none See Also: IElementFactory since: 3.0 |
getExportWizardRegistry | public IWizardRegistry getExportWizardRegistry()(Code) | | Return the export wizard registry.
the export wizard registry since: 3.1 |
getExtensionTracker | public IExtensionTracker getExtensionTracker()(Code) | |
Return 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,
IEditorDescriptor objects fall into this category.
the extension tracker See Also: IWorkbenchWindow.getExtensionTracker See Also: IWorkbenchPage.getExtensionTracker since: 3.1 |
getHelpSystem | public IWorkbenchHelpSystem getHelpSystem()(Code) | | Return the help system for this workbench.
the help system since: 3.1 |
getImportWizardRegistry | public IWizardRegistry getImportWizardRegistry()(Code) | | Return the import wizard registry.
the import wizard registry since: 3.1 |
getIntroManager | public IIntroManager getIntroManager()(Code) | | Return the intro manager for this workbench.
the intro manager for this workbench. Guaranteed not to benull . since: 3.0 |
getNewWizardRegistry | public IWizardRegistry getNewWizardRegistry()(Code) | | Return the new wizard registry.
the new wizard registry since: 3.1 |
getOperationSupport | public IWorkbenchOperationSupport getOperationSupport()(Code) | |
Returns the undoable operation support for the workbench.
the workbench operation support since: 3.1 |
getPerspectiveRegistry | public IPerspectiveRegistry getPerspectiveRegistry()(Code) | | Returns the perspective registry for the workbench.
the workbench perspective registry |
getPreferenceManager | public PreferenceManager getPreferenceManager()(Code) | | Returns the preference manager for the workbench.
the workbench preference manager |
getPreferenceStore | public IPreferenceStore getPreferenceStore()(Code) | | Returns the preference store for the workbench.
the workbench preference store since: 2.0PlatformUI.getPreferenceStore |
getProgressService | public IProgressService getProgressService()(Code) | | Returns the progress service for the workbench.
the progress service since: 3.0 |
getSharedImages | public ISharedImages getSharedImages()(Code) | | Returns the shared images for the workbench.
the shared image manager |
getThemeManager | public IThemeManager getThemeManager()(Code) | | Return the theme manager for this workbench.
the theme manager for this workbench.Guaranteed not to benull . since: 3.0 |
getViewRegistry | public IViewRegistry getViewRegistry()(Code) | | Returns the view registry for the workbench.
the workbench view registry since: 3.1 |
getWorkbenchWindowCount | public int getWorkbenchWindowCount()(Code) | | Returns 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.
the number of open windows since: 3.0 |
getWorkbenchWindows | public IWorkbenchWindow[] getWorkbenchWindows()(Code) | | Returns 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.
a list of open windows |
getWorkingSetManager | public IWorkingSetManager getWorkingSetManager()(Code) | | Returns the working set manager for the workbench.
the working set manager since: 2.0 |
isClosing | public boolean isClosing()(Code) | | Returns a boolean indicating whether the workbench is in the process of
closing.
true if the workbench is in the process ofclosing, false otherwise since: 3.1 |
openWorkbenchWindow | public IWorkbenchWindow openWorkbenchWindow(String perspectiveId, IAdaptable input) throws WorkbenchException(Code) | | Creates 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
openPerspective APIs 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.
Parameters: perspectiveId - the perspective id for the window's initial page, ornull for no initial page Parameters: input - the page input, or null if there is no currentinput. This is used to seed the input for the new page'sviews. the new workbench window exception: WorkbenchException - if a new window and page could not be opened See Also: IWorkbench.showPerspective(StringIWorkbenchWindowIAdaptable) |
openWorkbenchWindow | public IWorkbenchWindow openWorkbenchWindow(IAdaptable input) throws WorkbenchException(Code) | | Creates 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
openPerspective APIs to programmatically show a
perspective to avoid confusing the user.
Parameters: input - the page input, or null if there is no currentinput. This is used to seed the input for the new page'sviews. the new workbench window exception: WorkbenchException - if a new window and page could not be opened See Also: IWorkbench.showPerspective(StringIWorkbenchWindowIAdaptable) |
removeWindowListener | public void removeWindowListener(IWindowListener listener)(Code) | | Removes a window listener.
Parameters: listener - the window listener to remove since: 2.0 |
removeWorkbenchListener | public void removeWorkbenchListener(IWorkbenchListener listener)(Code) | | Removes a workbench listener.
Parameters: listener - the workbench listener to remove since: 3.2 |
restart | public boolean restart()(Code) | | Closes then restarts this workbench.
If the workbench has an open editor with unsaved content, the user will
be given the opportunity to save it.
true if the workbench was successfully closed, andfalse if it could not be closed since: 2.0 |
saveAll | public boolean saveAll(IShellProvider shellProvider, IRunnableContext runnableContext, ISaveableFilter filter, boolean confirm)(Code) | | Save all dirty saveables in the workbench that match the given filter.
Opens a dialog to prompt the user if confirm is true.
Return true if successful. Return false if the user has canceled the
command.
since: 3.3 Parameters: shellProvider - the provider used to obtain a shell in prompting isrequired. Clients can use a workbench window for this. Parameters: runnableContext - a runnable context that will be used to provide aprogress monitor while the save is taking place. Clients canuse a workbench window for this. Parameters: filter - the filter used to determine if a particular dirty saveableneeds to be saved or null if all dirtysaveables should be saved. Parameters: confirm - true to ask the user before saving unsavedchanges (recommended), and false to saveunsaved changes without asking true if the command succeeded, andfalse if the operation was canceled by the user oran error occurred while saving |
saveAllEditors | public boolean saveAllEditors(boolean confirm)(Code) | | Save all dirty editors in the workbench. Opens a dialog to prompt the
user if confirm is true. Return true if successful. Return
false if the user has canceled the command.
Parameters: confirm - true to ask the user before saving unsavedchanges (recommended), and false to saveunsaved changes without asking true if the command succeeded, andfalse if the operation was canceled by the user oran error occurred while saving |
showPerspective | public IWorkbenchPage showPerspective(String perspectiveId, IWorkbenchWindow window) throws WorkbenchException(Code) | | Shows 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 .
Parameters: perspectiveId - the perspective ID to show Parameters: window - the workbench window of the action calling this method. the workbench page that the perspective was shown exception: WorkbenchException - if the perspective could not be shown since: 2.0 |
showPerspective | public IWorkbenchPage showPerspective(String perspectiveId, IWorkbenchWindow window, IAdaptable input) throws WorkbenchException(Code) | | Shows 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 .
Parameters: perspectiveId - the perspective ID to show Parameters: window - the workbench window of the action calling this method. Parameters: input - the page input, or null if there is no currentinput. This is used to seed the input for the page's views the workbench page that the perspective was shown exception: WorkbenchException - if the perspective could not be shown since: 2.0 |
|
|