Community
Participate
Working Groups
This is a problem reported by Valentina Popescu (popescu@ca.ibm.com) on the eclipse corner forum. A code example is provided below to reproduce the problem. In the IPerspectiveFactory implementation class, a folder is created and then multiple view placeholders are added to it. When the perspective is shown, the space for the folder is shown. If you open a view that belongs in the folder, it opens in the folder area. If the view is then close, the folder area disappears - just like it should. The problem seems to be createFolder() adds a real PartTabFolder. However, the RootLayoutContainer only hides folders with are ContainerPlaceHolder (closing the view causes the PartTabFolder to be replaced with a ContainerPlaceHolder...that why the folder area disappears when the view is closed). It seems one possible solution is to change PageLayout::createFolder to add a ContainerPlaceHolder instead of a PartTabFolder. Change also FolderLayout::addView to convert the ContainerPlaceHolder into a real PartTabFolder. Here is the sample code sent by Valentina (modified a bit to work in our environment). public void createInitialLayout(IPageLayout layout) { //Top right IFolderLayout topRight = layout.createFolder( "topRight", IPageLayout.RIGHT, (float) 0.30, layout.getEditorArea()); // Top left. IFolderLayout topLeft = layout.createFolder( "topLeft", IPageLayout.TOP, (float) 0.75, layout.getEditorArea()); topLeft.addView(IPageLayout.ID_BOOKMARKS); topLeft.addView(IPageLayout.ID_RES_NAV); // bottomRight IFolderLayout bottomRight = layout.createFolder( "bottomRight", IPageLayout.BOTTOM, (float) 0.75, "topRight"); //add main trace views // IPluginDescriptor descriptor = PDPlugin.getDefault().getDescriptor(); // IExtensionPoint point = descriptor.getExtensionPoint(PLUGINPOINT_TRACE_VIEWER); // if (point != null) { // IExtension[] traceViewers = point.getExtensions(); // for (int i = 0; i < traceViewers.length; i++) { // IConfigurationElement[] configElements = // traceViewers[i].getConfigurationElements(); // for (int j = 0; j < configElements.length; j++) { // IConfigurationElement elt = configElements[j]; // if (elt.getName().equals("view")) { // topRight.addPlaceholder(elt.getAttribute("id")); topRight.addPlaceholder(IPageLayout.ID_OUTLINE); topRight.addPlaceholder(IPageLayout.ID_TASK_LIST); // } // } // } // } //add detail views // point = descriptor.getExtensionPoint(PLUGINPOINT_DETAIL_VIEWER); // if (point != null) { // IExtension[] detailViewers = point.getExtensions(); // for (int i = 0; i < detailViewers.length; i++) { // IConfigurationElement[] configElements = // detailViewers[i].getConfigurationElements(); // for (int j = 0; j < configElements.length; j++) { // IConfigurationElement elt = configElements[j]; // if (elt.getName().equals("view")) { // bottomRight.addPlaceholder(elt.getAttribute("id")); bottomRight.addPlaceholder(IPageLayout.ID_PROP_SHEET); // } // } // } // } layout.setEditorAreaVisible(false); } NOTES:
PRODUCT VERSION: R0.9
IPageLayout has new API to create a folder placeholder to avoid this problem. Fix in build > 2002-04-04