Reputation: 33
I am new to RCP and perhaps the question is basic but: in perspective with two views, how can one show only one of them at the beginning of the application?
Upvotes: 0
Views: 259
Reputation: 7229
try this
public class Perspective implements IPerspectiveFactory {
/** Top folder's id. */
public static final String FI_TOP = Bootstrap.PLUGIN_ID + ".topFolder";
/** Top folder's id. */
public static final String FI_BOTTOM = Bootstrap.PLUGIN_ID+ ".bottomFolder";
float ratioTop = 0.35f;
float ratioBottom = 0.60f;
private IPageLayout layout;
public void createInitialLayout(IPageLayout layout) {
this.layout = layout;
String editorAreaId = layout.getEditorArea();
layout.setEditorAreaVisible(false);
layout.createPlaceholderFolder(FI_TOP, IPageLayout.TOP, ratioTop, editorAreaId);
layout.createPlaceholderFolder(FI_BOTTOM, IPageLayout.BOTTOM, ratioBottom, editorAreaId);
//Opnen a view
layout.addView("MyViewId", IPageLayout.TOP, 0.9f, layout.getEditorArea());
}
public IPageLayout getLayout() {
return layout;
}
Upvotes: 1