Bug 9662 - return actual parents when not showing source roots at the top of projects
authordadubrow
Thu, 20 Aug 2009 15:14:59 -0500
changeset 74 30678d98b200
parent 73 82f772574273
child 75 689d22da9f18
Bug 9662 - return actual parents when not showing source roots at the top of projects
cdt/cdt_6_0_x/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BaseCElementContentProvider.java
--- a/cdt/cdt_6_0_x/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BaseCElementContentProvider.java	Wed Aug 19 14:42:39 2009 -0500
+++ b/cdt/cdt_6_0_x/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BaseCElementContentProvider.java	Thu Aug 20 15:14:59 2009 -0500
@@ -318,7 +318,11 @@
 		}
 		Object parent = null;
 		if (element instanceof ICElement) {
-			parent = ((ICElement)element).getParent();
+			if (element instanceof ICContainer && !CCorePlugin.showSourceRootsAtTopOfProject()) {
+				parent = ((ICContainer) element).getResource().getParent();
+			}
+			else
+				parent = ((ICElement)element).getParent(); 
 			// translate working copy parent to original TU,
 			// because working copies are never returned by getChildren
 			// this is necessary for proper show-in-target support