|
Eclipse Platform Release 3.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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:
This interface is not intended to be implemented by clients.
Field Summary | |
static String | CHANGE_ACTION_SET_HIDE
Change event id when an action set is hidden in a perspective. |
static String | CHANGE_ACTION_SET_SHOW
Change event id when an action set is shown in a perspective. |
static String | CHANGE_EDITOR_AREA_HIDE
Change event id when the editor area is hidden in a perspective. |
static String | CHANGE_EDITOR_AREA_SHOW
Change event id when the editor area is shown in a perspective. |
static String | CHANGE_EDITOR_CLOSE
Change event id when one or more editors are closed in a perspective. |
static String | CHANGE_EDITOR_OPEN
Change event id when one or more editors are opened in a perspective. |
static String | CHANGE_FAST_VIEW_ADD
Change event id when a fast view is added in a perspective. |
static String | CHANGE_FAST_VIEW_REMOVE
Change event id when a fast view is removed in a perspective. |
static String | CHANGE_RESET
Change event id when the perspective is reset to its original state. |
static String | CHANGE_RESET_COMPLETE
Change event id when the perspective has completed a reset to its original state. |
static String | CHANGE_VIEW_HIDE
Change event id when one or more views are hidden in a perspective. |
static String | CHANGE_VIEW_SHOW
Change event id when one or more views are shown in a perspective. |
static String | CHANGE_WORKING_SET_REPLACE
Change event id when the page working set was replaced |
static String | EDITOR_ID_ATTR
Deprecated. in 3.0 since the notion of markers this is not generally applicable. Use the IDE-specific constant IDE.EDITOR_ID_ATTR. |
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(IWorkbenchPart part)
Activates the given part. |
void | addPropertyChangeListener(IPropertyChangeListener listener)
Deprecated. individual views should store a working set if needed and register a property change listener directly with the working set manager to receive notification when the view working set is removed. |
void | bringToTop(IWorkbenchPart 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. |
boolean | close()
Closes this workbench page. |
boolean | closeAllEditors(boolean save)
Closes all of the editors belonging to this workbench page. |
boolean | closeEditor(IEditorPart editor,
boolean save)
Closes the given editor. |
boolean | closeEditors(IEditorReference[] editorRefs,
boolean save)
Closes the given Array of editor references. |
IEditorPart | findEditor(IEditorInput input)
Returns the editor with the specified input. |
IViewPart | findView(String viewId)
Returns the view in this page with the specified id. |
IViewReference | findViewReference(String viewId)
Returns the view reference with the specified id. |
IViewReference | findViewReference(String viewId,
String secondaryId)
Returns the view reference with the specified id and secondary id. |
IEditorPart | getActiveEditor()
Returns the active editor open in this page. |
IEditorPart[] | getDirtyEditors()
Returns a list of dirty editors in this page. |
IEditorReference[] | getEditorReferences()
Returns a array of references to open editors in this page. |
int | getEditorReuseThreshold()
Deprecated. |
IEditorPart[] | getEditors()
Deprecated. use #getEditorReferences() instead |
IAdaptable | getInput()
Returns the input for this page. |
String | getLabel()
Returns the page label. |
INavigationHistory | getNavigationHistory()
Returns the navigation history which manages a list of entries keeping the history of places (positions, selection and editors) the user visited making it easier to the user to move back and forward without losing context. |
IPerspectiveDescriptor | getPerspective()
Returns the current perspective descriptor for this page, or null if the is no current perspective. |
IViewReference[] | getViewReferences()
Returns a list of the reference to views visible on this page. |
IViewPart[] | getViews()
Deprecated. use #getViewReferences() instead. |
IViewPart[] | getViewStack(IViewPart part)
Returns an array of IViewParts that are stacked with the given part. |
IWorkbenchWindow | getWorkbenchWindow()
Returns the workbench window of this page. |
IWorkingSet | getWorkingSet()
Deprecated. individual views should store a working set if needed |
void | hideActionSet(String actionSetID)
Hides an action set in this page. |
void | hideView(IViewPart view)
Hides the given view. |
void | hideView(IViewReference view)
Hides the given view that belongs to the reference, if any. |
boolean | isEditorAreaVisible()
Returns whether the page's current perspective is showing the editor area. |
boolean | isEditorPinned(IEditorPart editor)
Returns true if the editor is pinned and should not be reused. |
boolean | isPartVisible(IWorkbenchPart part)
Returns whether the specified part is visible. |
IEditorPart | openEditor(IEditorInput input,
String editorId)
Opens an editor on the given input. |
IEditorPart | openEditor(IEditorInput input,
String editorId,
boolean activate)
Opens an editor on the given input. |
void | removePropertyChangeListener(IPropertyChangeListener listener)
Deprecated. individual views should store a working set if needed and register a property change listener directly with the working set manager to receive notification when the view working set is removed. |
void | resetPerspective()
Changes the visible views, their layout, and the visible action sets within the page to match the current perspective descriptor. |
void | reuseEditor(IReusableEditor editor,
IEditorInput input)
Reuses the specified editor by setting its new input. |
boolean | saveAllEditors(boolean confirm)
Saves the contents of all dirty editors belonging to this workbench page. |
boolean | saveEditor(IEditorPart editor,
boolean confirm)
Saves the contents of the given editor if dirty. |
void | savePerspective()
Saves the visible views, their layout, and the visible action sets for this page to the current perspective descriptor. |
void | savePerspectiveAs(IPerspectiveDescriptor perspective)
Saves the visible views, their layout, and the visible action sets for this page to the given perspective descriptor. |
void | setEditorAreaVisible(boolean showEditorArea)
Show or hide the editor area for the page's active perspective. |
void | setEditorReuseThreshold(int openEditors)
Deprecated. use IPageLayout.setEditorReuseThreshold(int openEditors) instead. |
void | setPerspective(IPerspectiveDescriptor perspective)
Changes the visible views, their layout, and the visible action sets within the page to match the given perspective descriptor. |
void | showActionSet(String actionSetID)
Shows an action set in this page. |
IViewPart | showView(String viewId)
Shows the view identified by the given view id in this page and gives it focus. |
IViewPart | showView(String viewId,
String secondaryId,
int mode)
Shows a view in this page with the given id and secondary id. |
Methods inherited from interface org.eclipse.ui.IPartService |
addPartListener, addPartListener, getActivePart, getActivePartReference, removePartListener, removePartListener |
Methods inherited from interface org.eclipse.ui.ISelectionService |
addPostSelectionListener, addPostSelectionListener, addSelectionListener, addSelectionListener, getSelection, getSelection, removePostSelectionListener, removePostSelectionListener, removeSelectionListener, removeSelectionListener |
Field Detail |
public static final String EDITOR_ID_ATTR
public static final String CHANGE_RESET
public static final String CHANGE_RESET_COMPLETE
public static final String CHANGE_VIEW_SHOW
public static final String CHANGE_VIEW_HIDE
public static final String CHANGE_EDITOR_OPEN
public static final String CHANGE_EDITOR_CLOSE
public static final String CHANGE_EDITOR_AREA_SHOW
public static final String CHANGE_EDITOR_AREA_HIDE
public static final String CHANGE_ACTION_SET_SHOW
public static final String CHANGE_ACTION_SET_HIDE
public static final String CHANGE_FAST_VIEW_ADD
public static final String CHANGE_FAST_VIEW_REMOVE
public static final String CHANGE_WORKING_SET_REPLACE
public static final int VIEW_ACTIVATE
public static final int VIEW_VISIBLE
public static final int VIEW_CREATE
Method Detail |
public void activate(IWorkbenchPart part)
public void addPropertyChangeListener(IPropertyChangeListener listener)
public void bringToTop(IWorkbenchPart part)
public boolean close()
If the page has an open editor with unsaved content, the user will be given the opportunity to save it.
public boolean closeAllEditors(boolean save)
If the page has open editors with unsaved content and save is true, the user will be given the opportunity to save them.
public boolean closeEditors(IEditorReference[] editorRefs, boolean save)
If any of the editors have unsaved content and save is true, the user will be given the opportunity to save them.
public boolean closeEditor(IEditorPart editor, boolean save)
If the editor has unsaved content and save is true, the user will be given the opportunity to save it.
public IViewPart findView(String viewId)
public IViewReference findViewReference(String viewId)
public IViewReference findViewReference(String viewId, String secondaryId)
public IEditorPart getActiveEditor()
This is the visible editor on the page, or, if there is more than one visible editor, this is the one most recently brought to top.
public IEditorPart findEditor(IEditorInput input)
public IEditorPart[] getEditors()
Note that each page has its own editors; editors are never shared between pages.
public IEditorReference[] getEditorReferences()
Note that each page has its own editors; editors are never shared between pages.
public IEditorPart[] getDirtyEditors()
public IAdaptable getInput()
public String getLabel()
public IPerspectiveDescriptor getPerspective()
public IViewReference[] getViewReferences()
Note that each page has its own views; views are never shared between pages.
public IViewPart[] getViews()
Note that each page has its own views; views are never shared between pages.
public IWorkbenchWindow getWorkbenchWindow()
public IWorkingSet getWorkingSet()
public void hideActionSet(String actionSetID)
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.
public void hideView(IViewPart view)
public void hideView(IViewReference view)
public boolean isPartVisible(IWorkbenchPart part)
public boolean isEditorAreaVisible()
public void reuseEditor(IReusableEditor editor, IEditorInput input)
public IEditorPart openEditor(IEditorInput input, String editorId) throws PartInitException
If this page already has an editor open on the target input that editor is activated; otherwise, a new editor is opened. Two editor inputs, input1 and input2, are considered the same if
input1.equals(input2) == true.
The editor type is determined by mapping editorId to an editor extension registered with the workbench. An editor id is passed rather than an editor object to prevent the accidental creation of more than one editor for the same input. It also guarantees a consistent lifecycle for editors, regardless of whether they are created by the user or restored from saved data.
public IEditorPart openEditor(IEditorInput input, String editorId, boolean activate) throws PartInitException
If this page already has an editor open on the target input that editor is brought to the front; otherwise, a new editor is opened. Two editor inputs are considered the same if they equal. See Object.equals(Object) and IEditorInput. If activate == true the editor will be activated.
The editor type is determined by mapping editorId to an editor extension registered with the workbench. An editor id is passed rather than an editor object to prevent the accidental creation of more than one editor for the same input. It also guarantees a consistent lifecycle for editors, regardless of whether they are created by the user or restored from saved data.
*
public void removePropertyChangeListener(IPropertyChangeListener listener)
public void resetPerspective()
For more information on perspective change see setPerspective().
public boolean saveAllEditors(boolean confirm)
If confirm is true the user is prompted to confirm the command.
public boolean saveEditor(IEditorPart editor, boolean confirm)
If confirm is true the user is prompted to confirm the command. Otherwise, the save happens without prompt.
The editor must belong to this workbench page.
public void savePerspective()
public void savePerspectiveAs(IPerspectiveDescriptor perspective)
public void setEditorAreaVisible(boolean showEditorArea)
public void setPerspective(IPerspectiveDescriptor perspective)
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.
public void showActionSet(String actionSetID)
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.
public IViewPart showView(String viewId) throws PartInitException
public IViewPart showView(String viewId, String secondaryId, int mode) throws PartInitException
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.
public boolean isEditorPinned(IEditorPart editor)
public int getEditorReuseThreshold()
public void setEditorReuseThreshold(int openEditors)
public INavigationHistory getNavigationHistory()
public IViewPart[] getViewStack(IViewPart part)
|
Eclipse Platform Release 3.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.