blob: 99fd1c60796528b10af82c89aea46471436c160a [file] [log] [blame]
<!doctype html public "-//w3c//dtd html 4.0//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Eclipse Workbench Extension Point: Perspective Extensions</title>
</head>
<body link="#0000FF" vlink="#800080">
<center>
<h1>
Perspective Extensions</h1></center>
<b><i>Identifier: </i></b>org.eclipse.ui.perspectiveExtensions
<p><b><i>Description: </i></b>This extension point is used to extend perspectives
registered by other plug-ins. A perspective defines the initial contents
of the window action bars (menu and toolbar) and the initial set of views
and their layout within a workbench page.&nbsp; Other plug-ins may contribute
actions or views to the perspective which appear when the perspective is
selected.&nbsp; Optional additions by other plug-ins are appended to the
initial definition.
<p><b><i>Configuration Markup:</i></b>
<p><tt>&nbsp;&nbsp; &lt;!ELEMENT perspectiveExtension (actionSet | viewShortcut
| perspectiveShortcut |</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; newWizardShortcut | view)*></tt>
<br><tt>&nbsp;&nbsp; &lt;!ATTLIST perspectiveExtension</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; targetID&nbsp;&nbsp; CDATA #REQUIRED</tt>
<br><tt>&nbsp;&nbsp; ></tt>
<blockquote>
<li>
<b>targetID</b> - the unique identifier of the perspective (as specified in the registry)
into which the contribution is made.</li>
</blockquote>
<tt>&nbsp;&nbsp; &lt;!ELEMENT actionSet EMPTY></tt>
<br><tt>&nbsp;&nbsp; &lt;!ATTLIST actionSet</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
CDATA #REQUIRED</tt>
<br><tt>&nbsp;&nbsp; ></tt>
<ul>
<li>
<b>id</b> - the unique identifier of the action set which will be added to the perspective.</li>
</ul>
<tt>&nbsp;&nbsp; &lt;!ELEMENT viewShortcut EMPTY></tt>
<br><tt>&nbsp;&nbsp; &lt;!ATTLIST viewShortcut</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
CDATA #REQUIRED</tt>
<br><tt>&nbsp;&nbsp; ></tt>
<ul>
<li>
<b>id</b> - the unique identifier of the view which will be added to the perspective's "Show
View" submenu of the "Perspective" menu.</li>
</ul>
<tt>&nbsp;&nbsp; &lt;!ELEMENT newWizardShortcut EMPTY></tt>
<br><tt>&nbsp;&nbsp; &lt;!ATTLIST newWizardShortcut</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
CDATA #REQUIRED</tt>
<br><tt>&nbsp;&nbsp; ></tt>
<ul>
<li>
<b>id</b> - the unique identifier of the new wizard which will be added to the perspective's
"New" submenu of the "File" menu.</li>
</ul>
<tt>&nbsp;&nbsp; &lt;!ELEMENT perspectiveShortcut EMPTY></tt>
<br><tt>&nbsp;&nbsp; &lt;!ATTLIST perspectiveShortcut</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
CDATA #REQUIRED</tt>
<br><tt>&nbsp;&nbsp; ></tt>
<ul>
<li>
<b>id</b> - the unique identifier of the perspective which will be added to the perspective's
"Open" submenu of the "Perspective" menu.</li>
</ul>
<tt>&nbsp;&nbsp; &lt;!ELEMENT view EMPTY></tt>
<br><tt>&nbsp;&nbsp; &lt;!ATTLIST view</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
CDATA #REQUIRED</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; relative&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
CDATA #REQUIRED</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; relationship&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
CDATA #REQUIRED</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ratio&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
CDATA #OPTIONAL</tt>
<br><tt>&nbsp;&nbsp; ></tt>
<ul>
<li>
<b>id</b> - the unique identifier of the view which will be added to the perspective layout.</li>
<li>
<b>relative</b> - the unique identifier of a view which already exists in the perspective.&nbsp;
This will be used as a reference point for placement of the view.&nbsp;
The relationship between these two views is defined by <tt>relationship</tt>.</li>
<li>
<b>relationship</b> - specifies the relationship between <tt>id</tt> and
<tt>relative</tt>.&nbsp; The following values are supported:</li>
<ul>&nbsp;
<br><b>stack</b> - the view extension will be stacked with the relative
view in a folder.
<br><b>left, right, top, bottom</b> - the view extension will be placed
beside the relative view.&nbsp; In this case a <tt>ratio</tt> must also
be defined.
<br>&nbsp;</ul>
<li>
<b>ratio</b> - the percentage of area within the relative view which will
be donated to the view extension.&nbsp; This must be defined as a floating
point value and lie between 0.0 and 1.0.</li>
</ul>
<b><i>Examples:</i></b>
<p>The following is an example of a perspective extension (note the subelements
and the way attributes are used):
<p><tt>&nbsp;&nbsp;&nbsp; &lt;extension point="org.eclipse.ui.perspectiveExtensions"></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;perspectiveExtension</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
targetID="org.eclipse.ui.resourcePerspective"></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;actionSet id="org.eclipse.jdt.ui.JavaActionSet"/></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;viewShortcut id="org.eclipse.jdt.ui.PackageExplorer"/></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;newWizardShortcut id="org.eclipse.jdt.ui.wizards.NewProjectCreationWizard"/></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;perspectiveShortcut id="org.eclipse.jdt.ui.JavaPerspective"/></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;view id="org.eclipse.jdt.ui.PackageExplorer"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
relative="org.eclipse.ui.views.ResourceNavigator"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
relationship="stack"/></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;view id="org.eclipse.jdt.ui.TypeHierarchy"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
relative="org.eclipse.ui.views.ResourceNavigator"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
relationship="left"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ratio="0.50"/></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/perspectiveExtension></tt>
<br><tt>&nbsp;&nbsp;&nbsp; &lt;/extension></tt>
<p>In the example above, an action set, view shortcut, new wizard shortcut,
and perspective shortcut are contributed to the initial contents of the
Resource Perspective.&nbsp; In addition, the Package Explorer view is stacked
on the Resource Navigator view and the Type Hierarchy view is added beside the
Resource Navigator view.
<p><b><i>Additional Notes: </i></b>The items defined within the perspective
extension are contributed to the initial contents of the target perspective.&nbsp;
Following this, the user may remove any contribution or add others to a
perspective from within the workbench user interface.
<p><a href="hglegal.htm"><img SRC="ngibmcpy.gif" ALT="Copyright IBM Corp. 2000, 2001. All Rights Reserved." BORDER=0 height=12 width=195></a>
</body>
</html>