透视图扩展

标识:org.eclipse.ui.perspectiveExtensions

描述:此扩展点用来扩展其它插件注册的透视图。透视图定义窗口操作栏(菜单和工具栏)的初始内容和工作台页面内的一组初始视图及其布局。其它插件可将在选择透视图时出现的操作或视图添加至透视图。其它插件的可选添加项被追加至初始定义。

配置标记:

   <!ELEMENT extension (perspectiveExtension*)>

   <!ATTLIST extension
     point CDATA #REQUIRED
     id    CDATA #IMPLIED
     name  CDATA #IMPLIED
   >

   <!ELEMENT perspectiveExtension (actionSet | viewShortcut | perspectiveShortcut | newWizardShortcut | view | showInPart)*>

   <!ATTLIST perspectiveExtension
     targetID CDATA #REQUIRED
   >

   <!ELEMENT actionSet EMPTY>

   <!ATTLIST actionSet
      id CDATA #REQUIRED
   >

   <!ELEMENT viewShortcut EMPTY>

   <!ATTLIST viewShortcut
      id CDATA #REQUIRED
   >

   <!ELEMENT perspectiveShortcut EMPTY>

   <!ATTLIST perspectiveShortcut
      id CDATA #REQUIRED
   >

   <!ELEMENT newWizardShortcut EMPTY>

   <!ATTLIST newWizardShortcut
      id CDATA #REQUIRED
   >

   <!ELEMENT showInPart EMPTY>

   <!ATTLIST showInPart
     id CDATA #IMPLIED
   >

   <!ELEMENT view EMPTY>

   <!ATTLIST view
     id           CDATA #REQUIRED
     relative     CDATA #REQUIRED
     relationship (stack|left|right|top|bottom|fast)
     ratio        CDATA #IMPLIED
     visible      (true | false)
   >

示例:以下是透视图扩展的示例(注意子元素以及使用属性的方式):

    <extension point="org.eclipse.ui.perspectiveExtensions">
        <perspectiveExtension
            targetID="org.eclipse.ui.resourcePerspective">
            <actionSet id="org.eclipse.jdt.ui.JavaActionSet"/>
            <viewShortcut id="org.eclipse.jdt.ui.PackageExplorer"/>
            <newWizardShortcut id="org.eclipse.jdt.ui.wizards.NewProjectCreationWizard"/>
            <perspectiveShortcut id="org.eclipse.jdt.ui.JavaPerspective"/>
            <view id="org.eclipse.jdt.ui.PackageExplorer"
                relative="org.eclipse.ui.views.ResourceNavigator" 
                relationship="stack"/>
            <view id="org.eclipse.jdt.ui.TypeHierarchy"
                relative="org.eclipse.ui.views.ResourceNavigator" 
                relationship="left" 
                ratio="0.50"/>
        </perspectiveExtension>
   </extension> 

在上述示例中,操作集、视图快捷方式、新建向导快捷方式和透视图快捷方式都被添加到“资源透视图”的初始内容。另外,“包资源管理器”视图还叠放在“资源导航器”上,而“类型层次结构”视图则添加到“资源导航器”的旁边。

API 信息:在透视图扩展中定义的项会被添加至目标透视图的初始内容。遵循此方法,用户可从工作台用户界面内的透视图中除去任何添加项或将其它添加项添加至该透视图。

Copyright (c) 2002, 2003 IBM Corporation and others. All rights reserved. 该程序及附带提供的资料是基于“一般公共许可证”(Common Public License) v1.0 的条款提供的,本发行版中提供了该许可证条款,并且也可 在以下位置处找到该条款:http://www.eclipse.org/legal/cpl-v10.htm