\r
import org.argeo.slc.core.structure.StructureAware;\r
import org.argeo.slc.core.structure.StructureElement;\r
+import org.argeo.slc.core.structure.StructurePath;\r
import org.argeo.slc.core.structure.StructureRegistry;\r
\r
/**\r
* registries, using <code>TreeSPath</code>. Convenient to be wrapped in\r
* classes which cannot extend it.\r
*/\r
-public class DefaultTreeSAware implements TreeSAware {\r
+public class DefaultTreeSAware implements StructureAware {\r
private StructureElement element;\r
+ private List<String> names = new Vector<String>();\r
private List<StructureAware> children = new Vector<StructureAware>();\r
\r
public StructureElement getElement() {\r
this.element = element;\r
}\r
\r
- public void onRegister(StructureRegistry registry) {\r
+ public void onRegister(StructureRegistry registry, StructurePath path) {\r
+ int index = 0;\r
for (StructureAware sAware : children) {\r
- registry.register(sAware.getElement());\r
- sAware.onRegister(registry);\r
+ TreeSPath childPath = ((TreeSPath) path).createChild(names\r
+ .get(index)\r
+ + index);\r
+ registry.register(childPath, sAware.getElement());\r
+ sAware.onRegister(registry, childPath);\r
+ index++;\r
}\r
}\r
\r
- public void addToPropagationList(StructureAware sAware) {\r
+ public void addToPropagationList(String name, StructureAware sAware) {\r
+ names.add(name);\r
children.add(sAware);\r
}\r
\r