Wednesday, February 11, 2009

Eclipse : Uncloseable ViewPart

There are some cases where view part must not be closed in a perpective. Eclipse RCP provides an easy way to make the viewpart uncloseable.

From the perspective class which defines the layout for the Perspective, the viewpart can be set uncloseable.



public void createInitialLayout(final IPageLayout layout)
{
final String editorArea = layout.getEditorArea();
layout.addView(View.ID, IPageLayout.LEFT, 0.5f, editorArea);
layout.getViewLayout(View.ID).setCloseable(false);
}

No comments: