Eclipse RCP - Perspective中的编辑器

时间:2010-02-05 16:43:06

标签: eclipse rcp

我如何在透视图中插入编辑器?

1 个答案:

答案 0 :(得分:6)

编辑不受观点的束缚。透视图是视图的集合,也可以是可视的编辑器区域。但是,哪个编辑器随时都是打开的,这是在工作台的控制之下,而不是视角。

但是,在RCP应用程序中,编辑器区域是可见的(或不是)。您可以使用用于自定义屏幕的初始透视工厂来控制此操作。 (请注意,透视通常不会打开/关闭编辑器区域。)

Here's an example from vogella.de

public class Perspective implements IPerspectiveFactory {
    public void createInitialLayout(IPageLayout layout) {
        String editorArea = layout.getEditorArea();
        layout.setEditorAreaVisible(true);
        layout.setFixed(true);
        layout.addStandaloneView(View.ID, false, IPageLayout.LEFT, 1.0f, editorArea);
    }
}
相关问题