+ refactoring of the JCR UI Model (in a MVC point of view)
[lgpl/argeo-commons.git] / eclipse / runtime / org.argeo.eclipse.ui / src / main / java / org / argeo / eclipse / ui / TreeParent.java
index 8989d69ad744c8af5b8f63c435f99637be524b53..c4e74a96fad28de8d0bd38a69f6d97245db87c4b 100644 (file)
@@ -33,19 +33,22 @@ public class TreeParent extends TreeObject {
        public synchronized void addChild(Object child) {
                loaded = true;
                children.add(child);
-               if (child instanceof TreeParent)
-                       ((TreeParent) child).setParent(this);
+               // bsinou: was 'if (child instanceof TreeParent)'
+               if (child instanceof TreeObject)
+                       ((TreeObject) child).setParent(this);
        }
 
        public synchronized void removeChild(Object child) {
                children.remove(child);
                if (child instanceof TreeParent)
                        ((TreeParent) child).setParent(null);
+               // TODO: clear subtree recursively
        }
 
        public synchronized void clearChildren() {
                loaded = false;
                children.clear();
+               // TODO: clear also the objects
        }
 
        public synchronized Object[] getChildren() {