For a custom Eclipse plugin, I've been looking into creating a perspective that will help organize views in a way that makes work easier for the editors, with the main requirement that we would like to simultaneously see two editor areas in the perspective.
Our plugin uses two new editor types: A "Workflow Editor" (WE) and a "Trial Editor" (TE) We would like to make sure that all instances of the WE are opened in one area of the perspective, and all in the TE are opened in a separate area.
Essentially, it looks like the perspective whose link is below, except that in place of the Java editing views in the top-right, we'd have the WE views, and in place of the text editing views in the bottom-right, we would have the TE views.
(http://dl.dropbox.com/u/4148918/eclipse-multi-editor.jpg)
I took a look at the tutorial on creating perspectives here: http://www.eclipse.org/articles/using-perspectives/PerspectiveArticle.html . While this is a good start, it looks like by default perspective layouts only support one editor area, in which all editor views are opened:
public void defineLayout(IPageLayout layout) {
// Editors are placed for free.
String editorArea = layout.getEditorArea();
// Place navigator and outline to left of
// editor area.
IFolderLayout left =
layout.createFolder("left", IPageLayout.LEFT, (float) 0.26, editorArea);
left.addView(IPageLayout.ID_RES_NAV);
left.addView(IPageLayout.ID_OUTLINE);
}
How would one customize this layout such that it has two editor areas instead of one, each of which supports the editing of one distinct file type? While I have found a couple of online samples where the editor pane is split, these examples don't inherently support the automatic opening of one file type in one of the editors vs. the other, which is a desired feature for this plugin.
Alternatively, could one use 'folders,' and have instances of each editor open in these specialized folders? If so, what would be the entry point for defining new views associated with these editors, like those enumerated with "IPageLayout.ID_*" above?
Would much appreciate any advice someone has -- I think it's a cool problem to get two editors to show up simultaneously in different sections of an eclipse plugin, and it would be great if we could get it to work!
How would one customize this layout such that it has two editor areas instead of one, each of which supports the editing of one distinct file type?
You can't. As you've mentioned, you can only define one editor area in an Eclipse perspective.
You have two choices. Your first choice is to create your own multi page editor with a "Workflow Editor" (WE) on one page and a "Trial Editor" (TE) on the other page.
You second choice is to build an Eclipse workspace from the ground up with two (or more) editor areas. You can look through the Eclipse source for help, but you would basically be building your own Eclipse.