blob: c4ca9787533734d54c160bd1c879720efa1ba355 [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: Views</title>
</head>
<body link="#0000FF" vlink="#800080">
<center>
<h1>
Views</h1></center>
<b><i>Identifier: </i></b>org.eclipse.ui.views
<p><b><i>Description: </i></b>This extension point is used to define additional
views for the workbench.&nbsp; A view is a visual component within a workbench
page.&nbsp; It is typically used to navigate a hierarchy of information
(like the workspace), open an editor,&nbsp; or display properties for the
active editor.&nbsp; The user can make a view visible from the View submenu
or close it from the view local title bar.
<p>In order to reduce the visual clutter in the Show View Dialog, views
should be grouped using categories.
<p><b><i>Configuration Markup:</i></b>
<p><tt>&nbsp;&nbsp; &lt;!ELEMENT category EMPTY></tt>
<br><tt>&nbsp;&nbsp; &lt;!ATTLIST category</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
CDATA #REQUIRED</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
CDATA #REQUIRED</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; parentCategory&nbsp;&nbsp; CDATA #IMPLIED</tt>
<br><tt>&nbsp;&nbsp; ></tt>
<ul>
<li>
<b>id</b> - a unique name that will be used to identify this category.</li>
<li>
<b>name</b> - a translatable name that will be used in the UI for this
category.</li>
<li>
<b>parentCategory</b> - an optional path composed of category IDs separated
by '/'. This attribute provides for creating category hierarchy.</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;&nbsp;&nbsp;&nbsp;
CDATA #REQUIRED</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name&nbsp;&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; category&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA
#IMPLIED</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; class&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; icon&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
CDATA #IMPLIED</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fastViewWidthRatio&nbsp;&nbsp;
CDATA #OPTIONAL</tt>
<br><tt>&nbsp;&nbsp; ></tt>
<ul>
<li>
<b>id</b> - a unique name that will be used to identify this view.</li>
<li>
<b>name</b> - a translatable name that will be used in the UI for this
view.</li>
<li>
<b>category</b> - an optional attribute that is composed of the category
IDs separated by '/'. Each referenced category must exist prior to being
referenced in this attribute.</li>
<li>
<b>class</b> - a fully qualified name of the class that implements <tt>org.eclipse.ui.IViewPart</tt>.
A common practice is to subclass <tt>org.eclipse.ui.part.ViewPart</tt>
in order to inherit the default functionality.</li>
<li>
<b>icon</b> - a relative name of the icon that will be associated with
the view.</li>
<li>
<b>fastViewWidthRatio</b> - the percentage of the width of the workbench that the view will take up
as an active fast view. This must be defined as a floating point value and lie between 0.05 and 0.95.
If no value is supplied, a default ratio will be used.</li>
</ul>
<b><i>Examples:</i></b>
<p>The following is an example of the extension point:
<p><tt>&nbsp;&nbsp; &lt;extension point="org.eclipse.ui.views"></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;category</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id="com.xyz.views.XYZviews"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name="XYZ"></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/category></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;view</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id="com.xyz.views.XYZView"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name="XYZ View"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; category="com.xyz.views.XYZviews"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; class="com.xyz.views.XYZView"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; icon="icons/XYZ.gif"></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/view></tt>
<br><tt>&nbsp;&nbsp; &lt;/extension></tt>
<p><b><i>API Information:</i></b> The value of the <tt>class</tt> attribute
must be a fully qualified name of a Java class that implements <tt>org.eclipse.ui.IViewPart.&nbsp;</tt>
It is common practice to subclass<tt> org.eclipse.ui.part.ViewPart</tt>
when developing a new view.
<p><b><i>Supplied Implementation</i></b>: The workbench provides a number
of standard views including Navigator, Properties, Outline and Tasks. From
the user point of view, these views are no different from any other view
provided by the plug-ins. All the views can be shown from the "Show View" submenu of the "Window" menu.
The position of a view is persistent: it is saved when the view is closed
and restored when the view is reopened in a single session.&nbsp; The position
is also persisted between workbench sessions.
<p><a href="hglegal2002.htm"><img SRC="ngibmcpy2002.gif" ALT="Copyright IBM Corporation and others 2000, 2002." BORDER=0></a>
</body>
</html>