Project: Eclipse_Platform_UI
Bug 98536 [Perspectives] [RCP] [ViewMgmt] How to prevent multiple instances of the same view from being closed/moved
Reported: 2005-06-06 11:42:58 | Status: resolved fixed

In our scenario we have registered a generic placeholder to define the position where multiple instances of the same view have to be displayed. This placeholder is defined in the createInitialLayout method of our perspective according to the following code: public class MyPerspective implements IPerspectiveFactory { public void createInitialLayout((IPageLayout layout){ .................. IFolderLayout folderMainContent = layout.createFolder("main", IPageLayout.RIGHT, 0.25f, editorId); folderMainContent.addView(WelcomeView.ID_VIEW); IViewLayout vlx = layout.getViewLayout(WelcomeView.ID_VIEW); vlx.setMoveable(false); vlx.setCloseable(false); folderMainContent.addPlaceholder(PlaceHolderView.ID_VIEW +":*"); layout.getViewLayout(PlaceHolderView.ID_VIEW+":*" ).setCloseable(false); ................. } } The views identified by PlaceHolderView.ID_VIEW and a unique secondary id are opened later using: IWorkbenchPage activePage = TellerPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow(). getActivePage(); (PlaceHolderView)activePage.showView(PlaceHolderView.ID_VIEW, generateUniqueId(), IWorkbenchPage.VIEW_ACTIVATE); All the generated views should be not closeable because, according to requirements, views can be closed only using push buttons . Despite the views have been defined as not closeable, they are (the red icon appears on the folder tab).

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Perspective.java