org.jlense.uiworks.perspectiveExtensions

Identifier: org.jlense.uiworks.perspectiveExtensions

Description: 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. Other plug-ins may contribute actions or views to the perspective which appear when the perspective is selected. Optional additions by other plug-ins are appended to the initial definition.

Configuration Markup:

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

  • targetID - the unique identifier of the perspective (as specified in the registry) into which the contribution is made.
  •    <!ELEMENT actionSet EMPTY>
       <!ATTLIST actionSet
          id        CDATA #REQUIRED
       >
    

    • id - the unique identifier of the action set which will be added to the perspective.

       <!ELEMENT viewAction EMPTY>
       <!ATTLIST viewAction
          id        CDATA #REQUIRED
       >
    

    • id - the unique identifier of the view which will be added to the perspective "Show View" submenu of the "Perspective" menu.

       <!ELEMENT newWizardAction EMPTY>
       <!ATTLIST newWizardAction
          id        CDATA #REQUIRED
       >
    

    • id - the unique identifier of the new wizard which will be added to the perspective "New" submenu of the "File" menu.

       <!ELEMENT perspectiveAction EMPTY>
       <!ATTLIST perspectiveAction
          id        CDATA #REQUIRED
       >
    

    • id - the unique identifier of the perspective which will be added to the perspective "Open" submenu of the "Perspective" menu.

       <!ELEMENT view EMPTY>
       <!ATTLIST view
          id               CDATA #REQUIRED
          relative         CDATA #REQUIRED
          relationship     CDATA #REQUIRED
          ratio            CDATA #OPTIONAL
       >
    

    • id - the unique identifier of the view which will be added to the perspective layout.
    • relative - the unique identifier of a view which already exists in the perspective. This will be used as a reference point for placement of the view. The relationship between these two views is defined by relationship.
    • relationship - specifies the relationship between id and relative. The following values are supported:

      • stack - the view extension will be stacked with the relative view in a folder.
        left, right, top, bottom - the view extension will be placed beside the relative view. In this case a ratio must also be defined.
    • ratio - the percentage of area within the relative view which will be donated to the view extension. This must be defined as a floating point value and lie between 0.0 and 1.0.

    Examples:

    The following is an example of a perspective extension (note the subelements and the way attributes are used):

        <extension point="org.jlense.uiworks.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>
    

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

    Additional Notes: The items defined within the perspective extension are contributed to the initial contents of the target perspective. Following this, the user may remove any contribution or add others to a perspective from within the workbench user interface.