简体   繁体   中英

Eclipse RCP - Editor in Perspective

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

Editors are not bound to perspectives like views are. Perspectives are collections of views, and optionally, a viewable editor area. However, which editor(s) are open at any time is something that's under the control of the workbench, and not the perspectives.

However, in an RCP application, the editor area is either visible (or not). You can control this with the initial perspective factory that's used to customise the screen. (Note that a perspective does not usually toggle the editor area on/off generally.)

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);
    }
}

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