| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML> |
| <HEAD> |
| |
| <meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2005. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." > |
| |
| <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> |
| <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> |
| |
| <LINK REL="STYLESHEET" HREF="../book.css" CHARSET="ISO-8859-1" TYPE="text/css"> |
| <script language="JavaScript" src="PLUGINS_ROOT/org.eclipse.help/livehelp.js"></script> |
| <TITLE>org.eclipse.ui.perspectiveExtensions</TITLE> |
| |
| <link rel="stylesheet" type="text/css" HREF="../book.css"> |
| </HEAD> |
| <BODY BGCOLOR="#ffffff"> |
| |
| |
| |
| <H3> |
| org.eclipse.ui.perspectiveExtensions</H3> |
| <P > |
| Plug-ins can add their own action sets, views, and various shortcuts to existing |
| perspectives by contributing to the <b><a href="../reference/extension-points/org_eclipse_ui_perspectiveExtensions.html">org.eclipse.ui.perspectiveExtensions</a></b> |
| extension point.</P> |
| |
| |
| <P >The contributions that can be defined for new perspectives (action sets, wizard entries, view layout, |
| view shortcuts, and perspective shortcuts) can also be supplied for |
| an existing perspective. One important difference is that these |
| contributions are |
| specified in the <b>plugin.xml</b> markup instead of |
| configuring them into an |
| <b><a href="../reference/api/org/eclipse/ui/IPageLayout.html"> IPageLayout</a>.</b> |
| </P> |
| |
| |
| <P >The following markup shows how the JDT extends the platform's debug |
| perspective.</P> |
| |
| |
| <pre> |
| <extension point="org.eclipse.ui.perspectiveExtensions"> |
| <perspectiveExtension |
| <b>targetID</b>="org.eclipse.debug.ui.DebugPerspective"> |
| <actionSet id="org.eclipse.jdt.debug.ui.JDTDebugActionSet"/> |
| <view id="org.eclipse.jdt.debug.ui.DisplayView" |
| relative="org.eclipse.debug.ui.ExpressionView" |
| relationship="stack"/> |
| <view id="org.eclipse.jdt.ui.PackageExplorer" |
| relative="org.eclipse.debug.ui.DebugView" |
| relationship="stack" |
| visible="false"/> |
| <view id="org.eclipse.jdt.ui.TypeHierarchy" |
| relative="org.eclipse.debug.ui.DebugView" |
| relationship="stack" |
| visible="false"/> |
| <view id="org.eclipse.search.SearchResultView" |
| relative="org.eclipse.debug.ui.ConsoleView" |
| relationship="stack" |
| visible="false"/> |
| <viewShortcut id="org.eclipse.jdt.debug.ui.DisplayView"/> |
| </perspectiveExtension> |
| </extension></pre> |
| |
| |
| <P >The <b>targetID</b> is the id of the perspective to which the plug-in is |
| contributing new behavior. The <b>actionSet</b> parameter identifies the <b>id</b> |
| of a previously declared action set that should be added to the target |
| perspective. This markup is analogous to using<b> |
| IPageLayout.addActionSet</b> in the <b><a href="../reference/api/org/eclipse/ui/IPerspectiveFactory.html">IPerspectiveFactory</a></b>.</P> |
| |
| |
| <P >Contributing a view to a perspective is a little more involved, since the |
| perspective page layout information must be declared. The <b>visible</b> |
| attribute controls whether the contributed view is initially visible when the perspective is |
| opened. In addition to |
| supplying the <b>id</b> of the contributed view, the id |
| of a view that already exists in the perspective ( a <b>relative</b> |
| view) must be specified as a reference point for placing the new view. The |
| <b>relationship</b> parameter specifies the layout |
| relationship between the new view and the <b>relative</b> |
| view. </P> |
| |
| |
| <ul> |
| <li> <b>stack</b> indicates that the |
| view will be stacked with the relative view in a folder</li> |
| <li><b>fast</b> indicates that the view will be shown as a fast |
| view </li> |
| <li> <b>left</b>, <b>right</b>, |
| <b>top</b>, or <b>bottom</b> indicate that the new view will be placed beside the <b>relative</b> |
| view. In this case, a <b> ratio</b> between 0.0 and 1.0 must be defined, which |
| indicates the percentage of area in the <b>relative</b> |
| view that will be allocated to the new view. </li> |
| </ul> |
| |
| |
| <P >Specifying a <b>perspectiveShortcut</b> |
| indicates that another perspective (specified by <b>id</b>) |
| should be added to the |
| |
| <a class="command-link" href='javascript:executeCommand("org.eclipse.ui.perspectives.showPerspective")'> |
| <img src="PLUGINS_ROOT/org.eclipse.help/command_link.png"> |
| <b>Window > Open Perspective...</b></a> |
| |
| menu of the target |
| perspective. This markup is analogous to calling <b>IPageLayout.addPerspectiveShortcut</b> |
| in the original perspective definition in the <b><a href="../reference/api/org/eclipse/ui/IPerspectiveFactory.html">IPerspectiveFactory</a></b>. |
| Plug-ins can also add view shortcuts and new wizard shortcuts in a similar |
| manner. </P> |
| |
| |
| <P >You can also specify one or more views as a valid <b>showInPart</b>. The |
| views should be specified by the id used in their <b><a href="../reference/extension-points/org_eclipse_ui_views.html">org.eclipse.ui.views</a></b> |
| extension contribution. This controls which views are available as |
| targets in the <b>Navigate > Show In </b>menu. The ability to specify a |
| "show in" view in the extension markup allows you to add your |
| newly contributed views as targets in another perspective's "show in" |
| menus. See <a href="workbench_perspectives.htm#showin">Linking views and |
| editors</a> for more information on "show in."</P> |
| |
| |
| <P > See <b><a href="../reference/extension-points/org_eclipse_ui_perspectiveExtensions.html">org.eclipse.ui.perspectiveExtensions</a></b> |
| for a complete definition of the extension point.</P> |
| |
| |
| <P > </P> |
| |
| |
| |
| |
| </BODY> |
| </HTML> |