Perspective Extensions

Identifier:
org.eclipse.ui.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 extension (perspectiveExtension*)>

<!ATTLIST extension

point CDATA #REQUIRED

id    CDATA #IMPLIED

name  CDATA #IMPLIED>


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

<!ATTLIST perspectiveExtension

targetID              IDREF #REQUIRED

editorOnboardingText  CDATA #IMPLIED

editorOnboardingImage CDATA #IMPLIED>


<!ELEMENT actionSet EMPTY>

<!ATTLIST actionSet

id IDREF #REQUIRED>


<!ELEMENT viewShortcut EMPTY>

<!ATTLIST viewShortcut

id IDREF #REQUIRED>


<!ELEMENT perspectiveShortcut EMPTY>

<!ATTLIST perspectiveShortcut

id IDREF #REQUIRED>


<!ELEMENT newWizardShortcut EMPTY>

<!ATTLIST newWizardShortcut

id IDREF #REQUIRED>


<!ELEMENT showInPart EMPTY>

<!ATTLIST showInPart

id IDREF #IMPLIED>


<!ELEMENT view EMPTY>

<!ATTLIST view

id           IDREF #REQUIRED

relative     IDREF #IMPLIED

relationship (stack|left|right|top|bottom|fast)

ratio        CDATA #IMPLIED

visible      (true | false)

closeable    (true | false)

moveable     (true | false)

standalone   (true | false)

showTitle    (true | false)

minimized    (true | false) "false">


<!ELEMENT hiddenMenuItem EMPTY>

<!ATTLIST hiddenMenuItem

id CDATA #REQUIRED>


<!ELEMENT hiddenToolBarItem EMPTY>

<!ATTLIST hiddenToolBarItem

id CDATA #REQUIRED>


<!ELEMENT editorOnboardingCommand EMPTY>

<!ATTLIST editorOnboardingCommand

id IDREF #REQUIRED>

The commands are shown including key binding in the editor area in case no editor is open. Up to five commands can be added.



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


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

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 and the Type Hierarchy View is added beside the Resource Navigator.

API Information:
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.


Copyright (c) 2002, 2007 IBM Corporation and others.
This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which accompanies this distribution, and is available at https://www.eclipse.org/legal/epl-v20.html/ SPDX-License-Identifier: EPL-2.0