+ // TreeSElement element = new TreeSElement(project.getDescription(),\r
+ // "Root");\r
+ // registry.register(getProjectPath(project), element);\r
+\r
+ }\r
+\r
+ private void registerProjectAndParents(Project project) {\r
+ StructureRegistry registry = (StructureRegistry) project\r
+ .getReference(REF_STRUCTURE_REGISTRY);\r
+ File rootDir = new File(project\r
+ .getUserProperty(SlcAntConfig.ROOT_DIR_PROPERTY))\r
+ .getAbsoluteFile();\r
+ File baseDir = project.getBaseDir().getAbsoluteFile();\r
+\r
+ List<File> dirs = new Vector<File>();\r
+ File currentDir = baseDir;\r
+ do {\r
+ dirs.add(currentDir);\r
+ currentDir = currentDir.getParentFile();\r
+ log.trace("List " + currentDir);\r
+ } while (!currentDir.equals(rootDir.getParentFile()));\r
+\r
+ TreeSPath currPath = null;\r
+ for (int i = dirs.size() - 1; i >= 0; i--) {\r
+ File dir = dirs.get(i);\r
+\r
+ String description = dir.getName();\r
+ File slcLocal = new File(dir.getPath() + File.separator\r
+ + slcLocalFileName);\r
+ if (slcLocal.exists()) {\r
+ Properties properties = SlcAntConfig.loadFile(slcLocal\r
+ .getAbsolutePath());\r
+ description = properties\r
+ .getProperty(SlcAntConfig.DIR_DESCRIPTION_PROPERTY);\r
+ }\r
+ TreeSElement element = new TreeSElement(description);\r
+\r
+ if (dir.equals(rootDir)) {\r
+ currPath = TreeSPath.createRootPath(rootDir.getName());\r
+ } else {\r
+ currPath = currPath.createChild(dir.getName());\r
+ }\r
+ registry.register(currPath, element);\r
+ }\r
+ project.addReference(REF_PROJECT_PATH, currPath);\r