简体   繁体   中英

Eclipse RCP Java Perspective extension

I want to extend the default Eclipse IDE 'Java' perspective with a new view which will be by default opened in the bottom panel (where we have for instance 'Problems', 'Search', 'Console', etc).

How to ensure that my new view will be shown in that bottom panel in the first position (before 'Problems' view)?

Use Perspective Extension .

In you extension node add a view node and set relative and relation attribute to accomplish your needs.

<extension point="org.eclipse.ui.perspectiveExtensions"> 
    <perspectiveExtension 
        targetID="existing Perspective ID to extend"> 
        <view id="Your View ID" 
            relative="offset View ID" 
            relationship="relation"/> 

        <!-- example -->
        <view id="org.eclipse.jdt.ui.TypeHierarchy" 
            relative="org.eclipse.ui.views.ResourceNavigator" 
            relationship="left" 
            ratio="0.50"/> 
    </perspectiveExtension> 
</extension> 

Perspective Extensions is the correct answer but you should use:

  • relationship="stack"
  • relative="org.eclipse.ui.console.ConsoleView"

Example:

<perspectiveExtension
            targetID="org.eclipse.jdt.ui.JavaPerspective">
         <view
               id="your.view.id"
               minimized="false"
               relationship="stack"
               relative="org.eclipse.ui.console.ConsoleView">
        </view>
</perspectiveExtension>

Start your Eclipse with your Plugin and open the View. It should appear next to the Console-View

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM