0

I'm currently developing an Eclipse RCP application. I want to create a perspective where I have 3 views (project explorer, editors area, and a custom view), each in a different column. Below them I want to have the console view.


Desired Layout

I don't know how to put the console view at the bottom. Also, the ratios I define for project explorer, custom view in relation to the editor area is not applied for some reason. The editors should take the 70% of the space, the rest equally between the custom view and the project explorer.

This is what I have right now:

     <view
           id="AvgPowerTool.SettingsView"
           minimized="false"
           ratio="0.15"
           relationship="right"
           relative="org.eclipse.ui.editorss"
           visible="true">
     </view>
     <view
           id="org.eclipse.ui.navigator.ProjectExplorer"
           minimized="false"
           ratio="0.15"
           relationship="left"
           relative="org.eclipse.ui.editorss"
           showTitle="true"
           standalone="false"
           visible="true">
     </view>
     <view
           id="org.eclipse.ui.console.ConsoleView"
           minimized="false"
           ratio="1"
           relationship="bottom"
           relative="org.eclipse.ui.editorss"
           visible="true">
     </view>
greg-449
  • 109,219
  • 232
  • 102
  • 145
dlvhdr
  • 482
  • 4
  • 19

1 Answers1

2

The order in which you declare the views is important in getting the view to stretch across the whole window. Declare the console view first:

 <view
       id="org.eclipse.ui.console.ConsoleView"
       minimized="false"
       ratio="0.75"
       relationship="bottom"
       relative="org.eclipse.ui.editorss"
       visible="true">
 </view>
 <view
       id="AvgPowerTool.SettingsView"
       minimized="false"
       ratio="0.85"
       relationship="right"
       relative="org.eclipse.ui.editorss"
       visible="true">
 </view>
 <view
       id="org.eclipse.ui.navigator.ProjectExplorer"
       minimized="false"
       ratio="0.15"
       relationship="left"
       relative="org.eclipse.ui.editorss"
       showTitle="true"
       standalone="false"
       visible="true">
 </view>

The ratios for views at the bottom (and right) give the percentage occupied by the views above (or to the left) of the view so they are large numbers. In my example the console view occupies the bottom 25% of the window, the project explorer the left most 15% and the settings view the right most 15%.

Note: You will need to do the 'Window > Reset Perspective' each time you change this values in the plugin.xml

greg-449
  • 109,219
  • 232
  • 102
  • 145
  • Thanks. I got the Idea, but to prevent future questions, where do I find a tutorial that explains these sort of basic things? – dlvhdr May 05 '15 at 14:32
  • If you have the Eclipse SDK and included SourceCode included you could always have a look at an existing perspective which is doing what you expect. It most of the time a good idea to look at the Eclipse Sources. – Peter Kirschner May 07 '15 at 06:49