Bug 2652 - [UI] EC - Folder with only placeholders is still visible (1GHQON6)
Summary: [UI] EC - Folder with only placeholders is still visible (1GHQON6)
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Ryan Cooper CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-10 22:40 EDT by Simon Arsenault CLA
Modified: 2002-04-05 10:48 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Arsenault CLA 2001-10-10 22:40:43 EDT
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:
Comment 1 DJ Houghton CLA 2001-10-29 19:07:19 EST
PRODUCT VERSION:
	R0.9

Comment 2 Simon Arsenault CLA 2002-04-05 10:48:43 EST
IPageLayout has new API to create a folder placeholder to avoid this problem. 
Fix in build > 2002-04-04