2012-04-19 67 views
0

我是RCP的新手,也许这个问题是基本的,但是:从两个视角来看, 的视角,在应用程序开始时,怎么只显示其中的一个?如何只显示一个视图

回答

1

试试这个

public class Perspective implements IPerspectiveFactory { 

     /** Top folder's id. */ 
     public static final String FI_TOP = Bootstrap.PLUGIN_ID + ".topFolder"; 
     /** Top folder's id. */ 
     public static final String FI_BOTTOM = Bootstrap.PLUGIN_ID+ ".bottomFolder"; 

     float ratioTop = 0.35f; 
     float ratioBottom = 0.60f; 

     private IPageLayout layout; 

     public void createInitialLayout(IPageLayout layout) { 
      this.layout = layout; 

      String editorAreaId = layout.getEditorArea(); 
      layout.setEditorAreaVisible(false); 

      layout.createPlaceholderFolder(FI_TOP, IPageLayout.TOP, ratioTop, editorAreaId); 
      layout.createPlaceholderFolder(FI_BOTTOM, IPageLayout.BOTTOM, ratioBottom, editorAreaId); 

      //Opnen a view 
      layout.addView("MyViewId", IPageLayout.TOP, 0.9f, layout.getEditorArea()); 

     } 

     public IPageLayout getLayout() { 
      return layout; 
     } 
+0

感谢路易斯的快速反应和原谅我的无知,但它是什么意思引导? – 2012-04-19 16:28:22

+0

哦对不起。 Bootstrap是我的激活类。 Bootstrap扩展了AbstractUIPlugin类 – 2012-04-19 16:48:05

+0

非常感谢Luiz,完美地工作。 – 2012-04-19 17:43:37