Add filtering of children nodes
authorMathieu Baudier <mbaudier@argeo.org>
Mon, 2 May 2011 15:32:30 +0000 (15:32 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Mon, 2 May 2011 15:32:30 +0000 (15:32 +0000)
git-svn-id: https://svn.argeo.org/commons/trunk@4493 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

eclipse/runtime/org.argeo.eclipse.ui.jcr/src/main/java/org/argeo/eclipse/ui/jcr/AbstractNodeContentProvider.java

index 72a14baf850c8251b6ed04e64db89d04d736803a..cc8afeafe01e141992ce0311da2918485ad20dd8 100644 (file)
@@ -63,10 +63,21 @@ public abstract class AbstractNodeContentProvider extends
                return children;
        }
 
+       /**
+        * To be overridden in order to filter out some nodes. Does nothing by
+        * default. The provided list is a temporary one and can thus be modified
+        * directly . (e.g. via an iterator)
+        */
+       protected List<Node> filterChildren(List<Node> children)
+                       throws RepositoryException {
+               return children;
+       }
+
        protected Object[] getChildren(Node node) throws RepositoryException {
                List<Node> nodes = new ArrayList<Node>();
                for (NodeIterator nit = node.getNodes(); nit.hasNext();)
                        nodes.add(nit.nextNode());
+               nodes = filterChildren(nodes);
                return nodes.toArray();
        }