Hi,
I've created a Perspective a I tried to set a placeholder in order to open the same view type in the same place.
public class Perspective implements IPerspectiveFactory {
public void createInitialLayout(IPageLayout layout) {
String editorArea = layout.getEditorArea();
layout.setEditorAreaVisible(false);
layout.setFixed(true);
layout.addStandaloneView(HistoryView.ID, false, IPageLayout.TOP, 0.10f, editorArea);
IFolderLayout bottomLeft = layout.createFolder("bottomLeft", IPageLayout.BOTTOM, 0.90f, editorArea);
bottomLeft.addPlaceholder(View.ID + ":id*");
bottomLeft.addView(View.ID);
bottomLeft.addView(XmlCodeView.ID);
}
}
When the plugin starts View opens correctly into the desired position.
When I try to open another View it is opened after XmlCodeView: the application works correctly, the only problem is the View position. This is the code which I use to open the view:
protected void view(XmlAutomaton automaton)
{
//...
IWorkbenchPage pg = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
//get the reference for your viewId
IViewReference ref = pg.findViewReference(View.ID);
//release the view
pg.hideView(ref);
try {
pg.showView(View.ID, "id1", IWorkbenchPage.VIEW_ACTIVATE);
} catch (PartInitException e) {
e.printStackTrace();
}
}
I will appreciate any suggestion.
Thanks a lot.