com.mindoo.remote.api.org.eclipse.ui
Interface IRemoteWorkbench

All Superinterfaces:
IRemoteEclipseWrapper, IRemoteServiceLocator

public interface IRemoteWorkbench
extends IRemoteServiceLocator, IRemoteEclipseWrapper

Remote API Wrapper for the org.eclipse.ui.IWorkbench (Online documentation)

Original documentation:
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.


Method Summary
 IRemoteWorkbenchWindow getActiveWorkbenchWindow()
          Returns the currently active window for this workbench (if any).
 IRemoteAdaptable getDefaultPageInput()
           
 IRemotePerspectiveRegistry getPerspectiveRegistry()
          Returns the perspective registry for the workbench.
 IRemoteWorkbenchWindow[] getWorkbenchWindows()
          Returns a list of the open main windows associated with this workbench.
 IRemoteWorkbenchWindow openWorkbenchWindow(java.lang.String perspectiveId, IRemoteAdaptable input)
          Creates and opens a new workbench window with one page.
 IRemoteWorkbenchPage showPerspective(java.lang.String perspectiveId, IRemoteWorkbenchWindow window)
          Shows the specified perspective to the user.
 
Methods inherited from interface com.mindoo.remote.api.org.eclipse.ui.services.IRemoteServiceLocator
getService, hasService
 
Methods inherited from interface com.mindoo.remote.api.IRemoteEclipseWrapper
_internalGetId, equalWrappedObjects
 

Method Detail

getActiveWorkbenchWindow

IRemoteWorkbenchWindow getActiveWorkbenchWindow()
                                                throws RemoteEclipseAPIException
Returns the currently active window for this workbench (if any). Returns null if there is no active workbench window.

Returns:
the active workbench window, or null if there is no active workbench window
Throws:
RemoteEclipseAPIException

getWorkbenchWindows

IRemoteWorkbenchWindow[] getWorkbenchWindows()
                                             throws RemoteEclipseAPIException
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.

Returns:
a list of open windows
Throws:
RemoteEclipseAPIException

getPerspectiveRegistry

IRemotePerspectiveRegistry getPerspectiveRegistry()
                                                  throws RemoteEclipseAPIException
Returns the perspective registry for the workbench.

Returns:
the workbench perspective registry
Throws:
RemoteEclipseAPIException

showPerspective

IRemoteWorkbenchPage showPerspective(java.lang.String perspectiveId,
                                     IRemoteWorkbenchWindow window)
                                     throws RemoteEclipseAPIException
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:

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
window - the workbench window of the action calling this method.
Returns:
the workbench page that the perspective was shown
Throws:
RemoteEclipseAPIException

openWorkbenchWindow

IRemoteWorkbenchWindow openWorkbenchWindow(java.lang.String perspectiveId,
                                           IRemoteAdaptable input)
                                           throws RemoteEclipseAPIException
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, or null for no initial page
input - the page input, or null if there is no current input. This is used to seed the input for the new page's views.
Returns:
the new workbench window
Throws:
RemoteEclipseAPIException

getDefaultPageInput

IRemoteAdaptable getDefaultPageInput()
                                     throws RemoteEclipseAPIException
Throws:
RemoteEclipseAPIException