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

All Superinterfaces:
IRemoteEclipseWrapper, IRemoteSelectionService

public interface IRemoteWorkbenchPage
extends IRemoteSelectionService, IRemoteEclipseWrapper

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

Original documentation:
A workbench page consists of an arrangement of views and editors intended to be presented together to the user in a single workbench window. A page can contain 0 or more views and 0 or more editors. These views and editors are contained wholly within the page and are not shared with other pages. The layout and visible action set for the page is defined by a perspective.

The number of views and editors within a page is restricted to simplify part management for the user. In particular:


Field Summary
static java.lang.String CHANGE_ACTION_SET_HIDE
          Change event id when an action set is hidden in a perspective.
static java.lang.String CHANGE_ACTION_SET_SHOW
          Change event id when an action set is shown in a perspective.
static java.lang.String CHANGE_EDITOR_AREA_HIDE
          Change event id when the editor area is shown in a perspective.
static java.lang.String CHANGE_EDITOR_AREA_SHOW
          Change event id when the editor area is shown in a perspective.
static java.lang.String CHANGE_EDITOR_CLOSE
          Change event id when one or more editors are closed in a perspective.
static java.lang.String CHANGE_EDITOR_OPEN
          Change event id when one or more editors are opened in a perspective.
static java.lang.String CHANGE_FAST_VIEW_ADD
          Change event id when an action set is hidden in a perspective.
static java.lang.String CHANGE_FAST_VIEW_REMOVE
          Change event id when a fast view is added in a perspective.
static java.lang.String CHANGE_RESET
          Change event id when the perspective is reset to its original state.
static java.lang.String CHANGE_RESET_COMPLETE
          Change event id when the perspective has completed a reset to its original state.
static java.lang.String CHANGE_VIEW_HIDE
          Change event id when one or more views are hidden in a perspective.
static java.lang.String CHANGE_VIEW_SHOW
          Change event id when one or more views are shown in a perspective.
static java.lang.String CHANGE_WORKING_SET_REPLACE
          Change event id when the page working set was replaced
static java.lang.String CHANGE_WORKING_SETS_REPLACE
          Change event id when the page working set was replaced
static java.lang.String EDITOR_ID_ATTR
           
static int STATE_MAXIMIZED
          State of a view in a given page when the page is zoomed in on the view stack.
static int STATE_MINIMIZED
          State of a view in a given page when the view stack is minimized.
static int STATE_RESTORED
          State of a view in a given page when the view stack is in it's normal state.
static int VIEW_ACTIVATE
          Show view mode that indicates the view should be made visible and activated.
static int VIEW_CREATE
          Show view mode that indicates the view should be made created but not necessarily be made visible.
static int VIEW_VISIBLE
          Show view mode that indicates the view should be made visible.
 
Method Summary
 void activate(IRemoteWorkbenchPart part)
          Activates the given part.
 void bringToTop(IRemoteWorkbenchPart part)
          Moves the given part forward in the Z order of this page so as to make it visible, without changing which part has focus.
 void closeAllPerspectives(boolean saveEditors, boolean closePage)
          Closes all perspectives in this page.
 void closePerspective(IRemotePerspectiveDescriptor desc, boolean saveEditors, boolean closePage)
          Closes the specified perspective in this page.
 IRemoteViewPart findView(java.lang.String viewId)
          Returns the view in this page with the specified id.
 IRemoteViewReference findViewReference(java.lang.String viewId)
          Returns the view reference with the specified id.
 IRemoteViewReference findViewReference(java.lang.String viewId, java.lang.String secondaryId)
          Returns the view reference with the specified id and secondary id.
 java.lang.String getLabel()
          Returns the page label.
 IRemotePerspectiveDescriptor[] getOpenPerspectives()
          Returns the descriptors for the perspectives that are open in this page, in the order in which they were opened.
 int getPartState(IRemoteWorkbenchPartReference ref)
          Returns the maximized/minimized/restored state of the given part reference.
 IRemotePerspectiveDescriptor getPerspective()
          Returns the current perspective descriptor for this page, or null if there is no current perspective.
 IRemoteWorkbenchPartReference getReference(IRemoteWorkbenchPart part)
          Find the part reference for the given part.
 IRemoteViewReference[] getViewReferences()
          Returns a list of the reference to views visible on this page.
 IRemoteViewPart[] getViewStack(IRemoteViewPart part)
          Returns an array of IViewParts that are stacked with the given part.
 IRemoteWorkbenchWindow getWorkbenchWindow()
          Returns the workbench window of this page.
 void hideActionSet(java.lang.String actionSetID)
          Hides an action set in this page.
 void hideView(IRemoteViewPart view)
          Hides the given view.
 void hideView(IRemoteViewReference view)
          Hides the given view that belongs to the reference, if any.
 boolean isPartVisible(IRemoteWorkbenchPart part)
          Returns whether the specified part is visible.
 void resetPerspective()
          Changes the visible views, their layout, and the visible action sets within the page to match the current perspective descriptor.
 void setPartState(IRemoteWorkbenchPartReference ref, int state)
          Set the state of the given part reference.
 void setPerspective(IRemotePerspectiveDescriptor perspective)
          Changes the visible views, their layout, and the visible action sets within the page to match the given perspective descriptor.
 void showActionSet(java.lang.String actionSetID)
          Shows an action set in this page.
 IRemoteViewPart showView(java.lang.String viewId)
          Shows the view identified by the given view id in this page and gives it focus.
 IRemoteViewPart showView(java.lang.String viewId, java.lang.String secondaryId, int mode)
          Shows a view in this page with the given id and secondary id.
 void toggleZoom(IRemoteWorkbenchPartReference ref)
          Zoom the page in on a part.
 
Methods inherited from interface com.mindoo.remote.api.org.eclipse.ui.IRemoteSelectionService
getSelectionAsURIs, getSelectionAsURIs, getSelectionAsURIs
 
Methods inherited from interface com.mindoo.remote.api.IRemoteEclipseWrapper
_internalGetId, equalWrappedObjects
 

Field Detail

VIEW_ACTIVATE

static final int VIEW_ACTIVATE
Show view mode that indicates the view should be made visible and activated. Use of this mode has the same effect as calling showView(String).

See Also:
Constant Field Values

VIEW_VISIBLE

static final int VIEW_VISIBLE
Show view mode that indicates the view should be made visible. If the view is opened in the container that contains the active view then this has the same effect as VIEW_CREATE.

See Also:
Constant Field Values

VIEW_CREATE

static final int VIEW_CREATE
Show view mode that indicates the view should be made created but not necessarily be made visible. It will only be made visible in the event that it is opened in its own container. In other words, only if it is not stacked with another view.

See Also:
Constant Field Values

STATE_MINIMIZED

static final int STATE_MINIMIZED
State of a view in a given page when the view stack is minimized.

See Also:
Constant Field Values

STATE_MAXIMIZED

static final int STATE_MAXIMIZED
State of a view in a given page when the page is zoomed in on the view stack.

See Also:
Constant Field Values

STATE_RESTORED

static final int STATE_RESTORED
State of a view in a given page when the view stack is in it's normal state.

See Also:
Constant Field Values

EDITOR_ID_ATTR

static final java.lang.String EDITOR_ID_ATTR
See Also:
Constant Field Values

CHANGE_RESET

static final java.lang.String CHANGE_RESET
Change event id when the perspective is reset to its original state.

See Also:
Constant Field Values

CHANGE_RESET_COMPLETE

static final java.lang.String CHANGE_RESET_COMPLETE
Change event id when the perspective has completed a reset to its original state.

See Also:
Constant Field Values

CHANGE_VIEW_SHOW

static final java.lang.String CHANGE_VIEW_SHOW
Change event id when one or more views are shown in a perspective.

See Also:
Constant Field Values

CHANGE_VIEW_HIDE

static final java.lang.String CHANGE_VIEW_HIDE
Change event id when one or more views are hidden in a perspective.

See Also:
Constant Field Values

CHANGE_EDITOR_OPEN

static final java.lang.String CHANGE_EDITOR_OPEN
Change event id when one or more editors are opened in a perspective.

See Also:
Constant Field Values

CHANGE_EDITOR_CLOSE

static final java.lang.String CHANGE_EDITOR_CLOSE
Change event id when one or more editors are closed in a perspective.

See Also:
Constant Field Values

CHANGE_EDITOR_AREA_SHOW

static final java.lang.String CHANGE_EDITOR_AREA_SHOW
Change event id when the editor area is shown in a perspective.

See Also:
Constant Field Values

CHANGE_EDITOR_AREA_HIDE

static final java.lang.String CHANGE_EDITOR_AREA_HIDE
Change event id when the editor area is shown in a perspective.

See Also:
Constant Field Values

CHANGE_ACTION_SET_SHOW

static final java.lang.String CHANGE_ACTION_SET_SHOW
Change event id when an action set is shown in a perspective.

See Also:
Constant Field Values

CHANGE_ACTION_SET_HIDE

static final java.lang.String CHANGE_ACTION_SET_HIDE
Change event id when an action set is hidden in a perspective.

See Also:
Constant Field Values

CHANGE_FAST_VIEW_ADD

static final java.lang.String CHANGE_FAST_VIEW_ADD
Change event id when an action set is hidden in a perspective.

See Also:
Constant Field Values

CHANGE_FAST_VIEW_REMOVE

static final java.lang.String CHANGE_FAST_VIEW_REMOVE
Change event id when a fast view is added in a perspective.

See Also:
Constant Field Values

CHANGE_WORKING_SET_REPLACE

static final java.lang.String CHANGE_WORKING_SET_REPLACE
Change event id when the page working set was replaced

See Also:
Constant Field Values

CHANGE_WORKING_SETS_REPLACE

static final java.lang.String CHANGE_WORKING_SETS_REPLACE
Change event id when the page working set was replaced

See Also:
Constant Field Values
Method Detail

closePerspective

void closePerspective(IRemotePerspectiveDescriptor desc,
                      boolean saveEditors,
                      boolean closePage)
                      throws RemoteEclipseAPIException
Closes the specified perspective in this page. If the last perspective in this page is closed, then all editors are closed. Views that are not shown in other perspectives are closed as well. If saveParts is true, the user will be prompted to save any unsaved changes for parts that are being closed. The page itself is closed if closePage is true.

Parameters:
desc - the descriptor of the perspective to be closed
saveEditors - whether the page's parts should be saved if closed
closePage - whether the page itself should be closed if last perspective
Throws:
RemoteEclipseAPIException

closeAllPerspectives

void closeAllPerspectives(boolean saveEditors,
                          boolean closePage)
                          throws RemoteEclipseAPIException
Closes all perspectives in this page. All editors are closed, prompting to save any unsaved changes if saveEditors is true. The page itself is closed if closePage is true.

Parameters:
saveEditors - whether the page's editors should be saved
closePage - whether the page itself should be closed
Throws:
RemoteEclipseAPIException

activate

void activate(IRemoteWorkbenchPart part)
              throws RemoteEclipseAPIException
Activates the given part. The part will be brought to the front and given focus. The part must belong to this page.

Parameters:
part - the part to activate
Throws:
RemoteEclipseAPIException

findView

IRemoteViewPart findView(java.lang.String viewId)
                         throws RemoteEclipseAPIException
Returns the view in this page with the specified id. There is at most one view in the page with the specified id.

Parameters:
viewId - the id of the view extension to use
Returns:
the view, or null if none is found
Throws:
RemoteEclipseAPIException

getPerspective

IRemotePerspectiveDescriptor getPerspective()
                                            throws RemoteEclipseAPIException
Returns the current perspective descriptor for this page, or null if there is no current perspective.

Returns:
the current perspective descriptor or null
Throws:
RemoteEclipseAPIException

hideView

void hideView(IRemoteViewReference view)
              throws RemoteEclipseAPIException
Hides the given view that belongs to the reference, if any.

Parameters:
view - the references whos view is to be hidden
Throws:
RemoteEclipseAPIException

hideView

void hideView(IRemoteViewPart view)
              throws RemoteEclipseAPIException
Hides the given view. The view must belong to this page.

Parameters:
view - the view to hide
Throws:
RemoteEclipseAPIException

isPartVisible

boolean isPartVisible(IRemoteWorkbenchPart part)
                      throws RemoteEclipseAPIException
Returns whether the specified part is visible.

Parameters:
part - the part to test
Returns:
boolean true if part is visible
Throws:
RemoteEclipseAPIException

findViewReference

IRemoteViewReference findViewReference(java.lang.String viewId)
                                       throws RemoteEclipseAPIException
Returns the view reference with the specified id.

Parameters:
viewId - the id of the view extension to use
Returns:
the view reference, or null if none is found
Throws:
RemoteEclipseAPIException

findViewReference

IRemoteViewReference findViewReference(java.lang.String viewId,
                                       java.lang.String secondaryId)
                                       throws RemoteEclipseAPIException
Returns the view reference with the specified id and secondary id.

Parameters:
viewId - the id of the view extension to use
secondaryId - the secondary id to use, or null for no secondary id
Returns:
the view reference, or null if none is found
Throws:
RemoteEclipseAPIException

showView

IRemoteViewPart showView(java.lang.String viewId,
                         java.lang.String secondaryId,
                         int mode)
                         throws RemoteEclipseAPIException
Shows a view in this page with the given id and secondary id. The behaviour of this method varies based on the supplied mode. If VIEW_ACTIVATE is supplied, the view is given focus. If VIEW_VISIBLE is supplied, then it is made visible but not given focus. Finally, if VIEW_CREATE is supplied the view is created and will only be made visible if it is not created in a folder that already contains visible views.

This allows multiple instances of a particular view to be created. They are disambiguated using the secondary id. If a secondary id is given, the view must allow multiple instances by having specified allowMultiple="true" in its extension.

Parameters:
viewId - the id of the view extension to use
secondaryId - the secondary id to use, or null for no secondary id
mode - the activation mode. Must be VIEW_ACTIVATE, VIEW_VISIBLE or VIEW_CREATE
Returns:
a view
Throws:
RemoteEclipseAPIException

showView

IRemoteViewPart showView(java.lang.String viewId)
                         throws RemoteEclipseAPIException
Shows the view identified by the given view id in this page and gives it focus. If there is a view identified by the given view id (and with no secondary id) already open in this page, it is given focus.

Parameters:
viewId - the id of the view extension to use
Returns:
the shown view
Throws:
RemoteEclipseAPIException

getViewStack

IRemoteViewPart[] getViewStack(IRemoteViewPart part)
                               throws RemoteEclipseAPIException
Returns an array of IViewParts that are stacked with the given part.

Parameters:
part - the part to test
Returns:
the parts that are stacked with this part, including the part in question. null is returned if the part does not belong to this page.
Throws:
RemoteEclipseAPIException

getViewReferences

IRemoteViewReference[] getViewReferences()
                                         throws RemoteEclipseAPIException
Returns a list of the reference to views visible on this page.

Note that each page has its own views; views are never shared between pages.

Returns:
a list of references to visible views
Throws:
RemoteEclipseAPIException

setPerspective

void setPerspective(IRemotePerspectiveDescriptor perspective)
                    throws RemoteEclipseAPIException
Changes the visible views, their layout, and the visible action sets within the page to match the given perspective descriptor. This is a rearrangement of components and not a replacement. The contents of the old perspective descriptor are unaffected.

When a perspective change occurs the old perspective is deactivated (hidden) and cached for future reference. Then the new perspective is activated (shown). The views within the page are shared by all existing perspectives to make it easy for the user to switch between one perspective and another quickly without loss of context.

During activation the action sets are modified. If an action set is specified in the new perspective which is not visible in the old one it will be created. If an old action set is not specified in the new perspective it will be disposed.

The visible views and their layout within the page also change. If a view is specified in the new perspective which is not visible in the old one a new instance of the view will be created. If an old view is not specified in the new perspective it will be hidden. This view may reappear if the user selects it from the View menu or if they switch to a perspective (which may be the old one) where the view is visible.

The open editors are not modified by this method.

Parameters:
perspective - the perspective descriptor
Throws:
RemoteEclipseAPIException

resetPerspective

void resetPerspective()
                      throws RemoteEclipseAPIException
Changes the visible views, their layout, and the visible action sets within the page to match the current perspective descriptor. This is a rearrangement of components and not a replacement. The contents of the current perspective descriptor are unaffected.

For more information on perspective change see setPerspective(IRemotePerspectiveDescriptor)

Throws:
RemoteEclipseAPIException

bringToTop

void bringToTop(IRemoteWorkbenchPart part)
                throws RemoteEclipseAPIException
Moves the given part forward in the Z order of this page so as to make it visible, without changing which part has focus. The part must belong to this page.

Parameters:
part - the part to bring forward
Throws:
RemoteEclipseAPIException

getLabel

java.lang.String getLabel()
                          throws RemoteEclipseAPIException
Returns the page label. This will be a unique identifier within the containing workbench window.

Returns:
the page label
Throws:
RemoteEclipseAPIException

getWorkbenchWindow

IRemoteWorkbenchWindow getWorkbenchWindow()
                                          throws RemoteEclipseAPIException
Returns the workbench window of this page.

Returns:
the workbench window
Throws:
RemoteEclipseAPIException

getOpenPerspectives

IRemotePerspectiveDescriptor[] getOpenPerspectives()
                                                   throws RemoteEclipseAPIException
Returns the descriptors for the perspectives that are open in this page, in the order in which they were opened.

Returns:
the open perspective descriptors, in order of opening
Throws:
RemoteEclipseAPIException

getReference

IRemoteWorkbenchPartReference getReference(IRemoteWorkbenchPart part)
                                           throws RemoteEclipseAPIException
Find the part reference for the given part. A convenience method to quickly go from part to part reference.

Parameters:
part - The part to search for. It can be null.
Returns:
The reference for the given part, or null if no reference can be found.
Throws:
RemoteEclipseAPIException

getPartState

int getPartState(IRemoteWorkbenchPartReference ref)
                 throws RemoteEclipseAPIException
Returns the maximized/minimized/restored state of the given part reference.

Parameters:
ref - the workbench part to query. Must not be null.
Returns:
one of the STATE_* contants.
Throws:
RemoteEclipseAPIException

setPartState

void setPartState(IRemoteWorkbenchPartReference ref,
                  int state)
                  throws RemoteEclipseAPIException
Set the state of the given part reference. Setting the state of one part can effect the state of other parts.

Parameters:
ref - the workbench part reference. Must not be null.
state - one of the STATE_* constants.
Throws:
RemoteEclipseAPIException

toggleZoom

void toggleZoom(IRemoteWorkbenchPartReference ref)
                throws RemoteEclipseAPIException
Zoom the page in on a part. If the part is already in zoom then zoom out.

Parameters:
ref - the workbench part to zoom in on. Must not be null.
Throws:
RemoteEclipseAPIException

showActionSet

void showActionSet(java.lang.String actionSetID)
                   throws RemoteEclipseAPIException
Shows an action set in this page.

In most cases where this method is used the caller is tightly coupled to a particular action set. They define it in the registry and may make it visible in certain scenarios by calling showActionSet. A static variable is often used to identify the action set id in caller code.

Parameters:
actionSetID - the action set to show
Throws:
RemoteEclipseAPIException

hideActionSet

void hideActionSet(java.lang.String actionSetID)
                   throws RemoteEclipseAPIException
Hides an action set in this page.

In most cases where this method is used the caller is tightly coupled to a particular action set. They define it in the registry and may make it visible in certain scenarios by calling showActionSet. A static variable is often used to identify the action set id in caller code.

Parameters:
actionSetID - the action set to hide
Throws:
RemoteEclipseAPIException