透视图扩展

标识符:org.eclipse.ui.perspectiveExtensions

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

配置标记:

   <!ELEMENT perspectiveExtension (actionSet | viewAction | perspectiveAction |
      newWizardAction | view)*>
   <!ATTLIST perspectiveExtension
      targetID   CDATA #REQUIRED
   >

  • targetID — 在其中进行添加的透视图的唯一标识符(如注册表中所指定的那样)。
  •    <!ELEMENT actionSet EMPTY>
       <!ATTLIST actionSet
          id         CDATA #REQUIRED
       >    <!ELEMENT viewAction EMPTY>
       <!ATTLIST viewAction
          id         CDATA #REQUIRED
       >    <!ELEMENT newWizardAction EMPTY>
       <!ATTLIST newWizardAction
          id         CDATA #REQUIRED
       >    <!ELEMENT perspectiveAction EMPTY>
       <!ATTLIST perspectiveAction
          id         CDATA #REQUIRED
       >    <!ELEMENT view EMPTY>
       <!ATTLIST view
          id                CDATA #REQUIRED
          relative          CDATA #REQUIRED
          relationship      CDATA #REQUIRED
          ratio             CDATA #OPTIONAL
       > 示例:

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

        <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>

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

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

    Copyright IBM Corp. 2000, 2001.  All Rights Reserved.