Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse RCP - Editor in Perspective

Tags:

eclipse

rcp

How would I go about inserting an editor inside of a perspective?

like image 253
Ohanes Dadian Avatar asked Feb 05 '10 16:02

Ohanes Dadian


1 Answers

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);
    }
}
like image 101
AlBlue Avatar answered Oct 31 '22 12:10

AlBlue