public interface IPageLayout
This interface is not intended to be implemented by clients.
When a perspective is opened, it creates a new page layout with a single editor area.
This layout is then passed to the perspective factory (implementation of
IPerspectiveFactory.createInitialLayout(IPageLayout)
) where
additional views and other content can be added, using the existing editor area as
the initial point of reference.
In some cases, multiple instances of a particular view may need to be added
to the same layout. These are disambiguated using a secondary id.
In layout methods taking a view id, the id can have the compound form:
primaryId [':' secondaryId].
If a secondary id is given, the view must allow multiple instances by
having specified allowMultiple="true"
in its extension.
View placeholders may also have a secondary id.
Wildcards are permitted in placeholder ids (but not regular view ids). '*' matches any substring, '?' matches any single character. Wildcards can be specified for the primary id, the secondary id, or both. For example, the placeholder "someView:*" will match any occurrence of the view that has primary id "someView" and that also has some non-null secondary id. Note that this placeholder will not match the view if it has no secondary id, since the compound id in this case is simply "someView".
Example of populating a layout with standard workbench views:
IPageLayout layout = ... // Get the editor area. String editorArea = layout.getEditorArea(); // Top left: Project Explorer view and Bookmarks view placeholder IFolderLayout topLeft = layout.createFolder("topLeft", IPageLayout.LEFT, 0.25f, editorArea); topLeft.addView(IPageLayout.ID_PROJECT_EXPLORER); topLeft.addPlaceholder(IPageLayout.ID_BOOKMARKS); // Bottom left: Outline view and Property Sheet view IFolderLayout bottomLeft = layout.createFolder("bottomLeft", IPageLayout.BOTTOM, 0.50f, "topLeft"); bottomLeft.addView(IPageLayout.ID_OUTLINE); bottomLeft.addView(IPageLayout.ID_PROP_SHEET); // Bottom right: Task List view layout.addView(IPageLayout.ID_TASK_LIST, IPageLayout.BOTTOM, 0.66f, editorArea);
Modifier and Type | Field and Description |
---|---|
static int |
BOTTOM
Relationship constant indicating a part should be placed below its
relative.
|
static float |
DEFAULT_FASTVIEW_RATIO
Deprecated.
discontinued support for fast views
|
static float |
DEFAULT_VIEW_RATIO
The default view ratio width for regular (non-fast) views.
|
static String |
ID_BOOKMARKS
The view id for the workbench's Bookmark Navigator standard component.
|
static String |
ID_EDITOR_AREA
The part id for the workbench's editor area.
|
static String |
ID_NAVIGATE_ACTION_SET
Id of the navigate action set.
|
static String |
ID_OUTLINE
The view id for the workbench's Content Outline standard component.
|
static String |
ID_PROBLEM_VIEW
The view id for the workbench's Problems View standard component.
|
static String |
ID_PROGRESS_VIEW
The view id for the workbench's Progress View standard component.
|
static String |
ID_PROJECT_EXPLORER
The view id for the Project Explorer.
|
static String |
ID_PROP_SHEET
The view id for the workbench's Property Sheet standard component.
|
static String |
ID_RES_NAV
Deprecated.
this has been replaced by the Common Navigator Framework as
of release 3.5.
|
static String |
ID_TASK_LIST
The view id for the workbench's Task List standard component.
|
static float |
INVALID_RATIO
A variable used to represent invalid ratios.
|
static int |
LEFT
Relationship constant indicating a part should be placed to the left of
its relative.
|
static float |
NULL_RATIO
A variable used to represent a ratio which has not been specified.
|
static float |
RATIO_MAX
Maximum acceptable ratio value when adding a view
|
static float |
RATIO_MIN
Minimum acceptable ratio value when adding a view
|
static int |
RIGHT
Relationship constant indicating a part should be placed to the right of
its relative.
|
static int |
TOP
Relationship constant indicating a part should be placed above its
relative.
|
Modifier and Type | Method and Description |
---|---|
void |
addActionSet(String actionSetId)
Adds an action set with the given id to this page layout.
|
void |
addFastView(String viewId)
Deprecated.
discontinued support for fast views
|
void |
addFastView(String viewId,
float ratio)
Deprecated.
discontinued support for fast views
|
void |
addNewWizardShortcut(String id)
Adds a new wizard shortcut to the page layout.
|
void |
addPerspectiveShortcut(String id)
Adds a perspective shortcut to the page layout.
|
void |
addPlaceholder(String viewId,
int relationship,
float ratio,
String refId)
Adds a view placeholder to this page layout.
|
void |
addShowInPart(String id)
Adds an item to the Show In prompter.
|
void |
addShowViewShortcut(String id)
Adds a show view shortcut to the page layout.
|
void |
addStandaloneView(String viewId,
boolean showTitle,
int relationship,
float ratio,
String refId)
Adds a standalone view with the given compound id to this page layout.
|
void |
addStandaloneViewPlaceholder(String viewId,
int relationship,
float ratio,
String refId,
boolean showTitle)
Adds a standalone view placeholder to this page layout.
|
void |
addView(String viewId,
int relationship,
float ratio,
String refId)
Adds a view with the given compound id to this page layout.
|
IFolderLayout |
createFolder(String folderId,
int relationship,
float ratio,
String refId)
Creates and adds a new folder with the given id to this page layout.
|
IPlaceholderFolderLayout |
createPlaceholderFolder(String folderId,
int relationship,
float ratio,
String refId)
Creates and adds a placeholder for a new folder with the given id to this page layout.
|
IPerspectiveDescriptor |
getDescriptor()
Returns the perspective descriptor for the perspective being layed out.
|
String |
getEditorArea()
Returns the special identifier for the editor area in this page
layout.
|
int |
getEditorReuseThreshold()
Deprecated.
this always returns -1 as of Eclipse 2.1
|
IPlaceholderFolderLayout |
getFolderForView(String id)
Returns the folder layout for the view or placeholder with the given
compound id in this page layout.
|
IViewLayout |
getViewLayout(String id)
Returns the layout for the view or placeholder with the given compound id in
this page layout.
|
boolean |
isEditorAreaVisible()
Returns whether the page's layout will show
the editor area.
|
boolean |
isFixed()
Returns
true if this layout is fixed, false if not. |
void |
setEditorAreaVisible(boolean showEditorArea)
Show or hide the editor area for the page's layout.
|
void |
setEditorReuseThreshold(int openEditors)
Deprecated.
this method has no effect, as of Eclipse 2.1
|
void |
setFixed(boolean isFixed)
Sets whether this layout is fixed.
|
static final String ID_EDITOR_AREA
@Deprecated static final String ID_RES_NAV
static final String ID_PROJECT_EXPLORER
static final String ID_PROP_SHEET
static final String ID_OUTLINE
static final String ID_BOOKMARKS
static final String ID_PROBLEM_VIEW
static final String ID_PROGRESS_VIEW
static final String ID_TASK_LIST
static final String ID_NAVIGATE_ACTION_SET
"org.eclipse.ui.NavigateActionSet"
)static final int LEFT
static final int RIGHT
static final int TOP
static final int BOTTOM
static final float RATIO_MIN
static final float RATIO_MAX
@Deprecated static final float DEFAULT_FASTVIEW_RATIO
static final float DEFAULT_VIEW_RATIO
static final float INVALID_RATIO
static final float NULL_RATIO
void addActionSet(String actionSetId)
"org.eclipse.ui.actionSet"
).actionSetId
- the action set id@Deprecated void addFastView(String viewId)
IPageLayout
type documentation for more details about compound ids.
The primary id must name a view contributed to the workbench's view extension
point (named "org.eclipse.ui.views"
).viewId
- the compound id of the view to be added@Deprecated void addFastView(String viewId, float ratio)
IPageLayout
type documentation for more details about compound ids.
The primary id must name a view contributed to the workbench's view extension
point (named "org.eclipse.ui.views"
).viewId
- the compound id of the view to be addedratio
- the percentage of the workbench the fast view will covervoid addNewWizardShortcut(String id)
"org.eclipse.ui.newWizards"
).id
- the wizard idvoid addPerspectiveShortcut(String id)
"org.eclipse.ui.perspectives"
).id
- the perspective idvoid addPlaceholder(String viewId, int relationship, float ratio, String refId)
IPageLayout
type documentation for more details about compound ids.
If the placeholder contains wildcards, it remains in the layout, otherwise
it is replaced by the view.
If the primary id of the placeholder has no wildcards, it must refer to a view
contributed to the workbench's view extension point
(named "org.eclipse.ui.views"
).viewId
- the compound view id (wildcards allowed)relationship
- the position relative to the reference part;
one of TOP
, BOTTOM
, LEFT
,
or RIGHT
ratio
- a ratio specifying how to divide the space currently occupied by the reference part,
in the range 0.05f
to 0.95f
.
Values outside this range will be clipped to facilitate direct manipulation.
For a vertical split, the part on top gets the specified ratio of the current space
and the part on bottom gets the rest.
Likewise, for a horizontal split, the part at left gets the specified ratio of the current space
and the part at right gets the rest.refId
- the id of the reference part; either a view id, a folder id,
or the special editor area id returned by getEditorArea
void addShowInPart(String id)
"org.eclipse.ui.views"
).id
- the view idvoid addShowViewShortcut(String id)
"org.eclipse.ui.views"
).id
- the view idvoid addView(String viewId, int relationship, float ratio, String refId)
IPageLayout
type documentation for more details about compound ids.
The primary id must name a view contributed to the workbench's view extension point
(named "org.eclipse.ui.views"
).viewId
- the compound view idrelationship
- the position relative to the reference part;
one of TOP
, BOTTOM
, LEFT
,
or RIGHT
ratio
- a ratio specifying how to divide the space currently occupied by the reference part,
in the range 0.05f
to 0.95f
.
Values outside this range will be clipped to facilitate direct manipulation.
For a vertical split, the part on top gets the specified ratio of the current space
and the part on bottom gets the rest.
Likewise, for a horizontal split, the part at left gets the specified ratio of the current space
and the part at right gets the rest.refId
- the id of the reference part; either a view id, a folder id,
or the special editor area id returned by getEditorArea
IFolderLayout createFolder(String folderId, int relationship, float ratio, String refId)
folderId
- the id for the new folder. This must be unique within
the layout to avoid collision with other parts.relationship
- the position relative to the reference part;
one of TOP
, BOTTOM
, LEFT
,
or RIGHT
ratio
- a ratio specifying how to divide the space currently occupied by the reference part,
in the range 0.05f
to 0.95f
.
Values outside this range will be clipped to facilitate direct manipulation.
For a vertical split, the part on top gets the specified ratio of the current space
and the part on bottom gets the rest.
Likewise, for a horizontal split, the part at left gets the specified ratio of the current space
and the part at right gets the rest.refId
- the id of the reference part; either a view id, a folder id,
or the special editor area id returned by getEditorArea
IPlaceholderFolderLayout createPlaceholderFolder(String folderId, int relationship, float ratio, String refId)
folderId
- the id for the new folder. This must be unique within
the layout to avoid collision with other parts.relationship
- the position relative to the reference part;
one of TOP
, BOTTOM
, LEFT
,
or RIGHT
ratio
- a ratio specifying how to divide the space currently occupied by the reference part,
in the range 0.05f
to 0.95f
.
Values outside this range will be clipped to facilitate direct manipulation.
For a vertical split, the part on top gets the specified ratio of the current space
and the part on bottom gets the rest.
Likewise, for a horizontal split, the part at left gets the specified ratio of the current space
and the part at right gets the rest.refId
- the id of the reference part; either a view id, a folder id,
or the special editor area id returned by getEditorArea
String getEditorArea()
ID_EDITOR_AREA
.
The editor area is automatically added to each layout before anything else. It should be used as the point of reference when adding views to a layout.
boolean isEditorAreaVisible()
true
when editor area visible, false
otherwisevoid setEditorAreaVisible(boolean showEditorArea)
showEditorArea
- true
to show the editor area, false
to hide the editor area@Deprecated int getEditorReuseThreshold()
@Deprecated void setEditorReuseThreshold(int openEditors)
openEditors
- the number of open editorsvoid setFixed(boolean isFixed)
isFixed
- true
if this layout is fixed, false
if notboolean isFixed()
true
if this layout is fixed, false
if not.
In a fixed layout, layout parts cannot be moved or zoomed, and the initial
set of views cannot be closed.
The default is false
.true
if this layout is fixed, false
if not.IViewLayout getViewLayout(String id)
IPageLayout
type documentation for more details about compound ids.
Returns null
if the specified view or placeholder is unknown to the layout.id
- the compound view id or placeholdernull
void addStandaloneView(String viewId, boolean showTitle, int relationship, float ratio, String refId)
IPageLayout
type documentation for more details about compound ids.
A standalone view cannot be docked together with other views.
A standalone view's title can optionally be hidden. If hidden,
then any controls typically shown with the title (such as the close button)
are also hidden. Any contributions or other content from the view itself
are always shown (e.g. toolbar or view menu contributions, content description).
The id must name a view contributed to the workbench's view extension point
(named "org.eclipse.ui.views"
).
viewId
- the compound view idshowTitle
- true
to show the title and related controls,
false
to hide themrelationship
- the position relative to the reference part;
one of TOP
, BOTTOM
, LEFT
,
or RIGHT
ratio
- a ratio specifying how to divide the space currently occupied by the reference part,
in the range 0.05f
to 0.95f
.
Values outside this range will be clipped to facilitate direct manipulation.
For a vertical split, the part on top gets the specified ratio of the current space
and the part on bottom gets the rest.
Likewise, for a horizontal split, the part at left gets the specified ratio of the current space
and the part at right gets the rest.refId
- the id of the reference part; either a view id, a folder id,
or the special editor area id returned by getEditorArea
void addStandaloneViewPlaceholder(String viewId, int relationship, float ratio, String refId, boolean showTitle)
IPageLayout
type
documentation for more details about compound ids. If the placeholder
contains wildcards, it remains in the layout, otherwise it is replaced by
the view. If the primary id of the placeholder has no wildcards, it must
refer to a view contributed to the workbench's view extension point
(named "org.eclipse.ui.views"
).viewId
- the compound view id (wildcards allowed)relationship
- the position relative to the reference part; one of
TOP
, BOTTOM
, LEFT
,
or RIGHT
ratio
- a ratio specifying how to divide the space currently occupied
by the reference part, in the range 0.05f
to
0.95f
. Values outside this range will be
clipped to facilitate direct manipulation. For a vertical
split, the part on top gets the specified ratio of the current
space and the part on bottom gets the rest. Likewise, for a
horizontal split, the part at left gets the specified ratio of
the current space and the part at right gets the rest.refId
- the id of the reference part; either a view id, a folder id,
or the special editor area id returned by
getEditorArea
showTitle
- true to show the view's title, false if notIPerspectiveDescriptor getDescriptor()
IPlaceholderFolderLayout getFolderForView(String id)
IPageLayout
type
documentation for more details about compound ids. Returns
null
if the specified view or placeholder is unknown to
the layout, or the placeholder was not in a folder.id
- the compound view id or placeholder. Must not be
null
.null
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.