How to create a Perspective

From Bioclipse
Jump to: navigation, search
Development tutorial
Responsible author:Ola
Bioclipse version:N/A
"N/A" is not a number.
Last updated:2009-10-10
Tags:


This page is to provide guidance for creating a perspective. For a more complete tutorial, see: http://www.eclipse.org/articles/using-perspectives/PerspectiveArticle.html

Define the perspective in plugin.xml

<extension point="org.eclipse.ui.perspectives">
  <perspective
        name="Test"
        class="org.eclipse.ui.articles.perspective.TestPerspective"
        id="org.eclipse.ui.articles.perspective.Test">
  </perspective>
</extension>

Implement the perspective class

public class MyPerspective implements IPerspectiveFactory {...}


Contribute to another perspective

I will examplify by showing how Jmol contributes the JmolView to the PcorePerspective

<extension
      point="org.eclipse.ui.perspectiveExtensions"
      id="jmolPerspectiveExtension">
   <perspectiveExtension
         targetID="net.bioclipse.pcore.PcorePerspective">
         <view
               id="net.bioclipse.jmol.views.JmolView"
               relative="org.eclipse.ui.editorss"
               relationship="right"
               ratio="0.70">
         </view>
         <viewShortcut
               id="net.bioclipse.jmol.views.JmolView">
         </viewShortcut>
   </perspectiveExtension>
</extension>

The 'relative="org.eclipse.ui.editorss"' is the editor part, but could also be a view. More information: http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/workbench_advext_perspectiveExtension.htm