[Dive4elements-commits] [PATCH 1 of 9] Show top level folder icons only if node has no factory

Wald Commits scm-commit at wald.intevation.org
Wed Mar 27 15:40:07 CET 2013


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1364318953 -3600
# Node ID f2371f3aaf037e57f61911454ce8d94d20904c33
# Parent  16c14e5ab00f4a0a90942f51bc61fa103b493f33
Show top level folder icons only if node has no factory

    If you have an empty folder the folder icon is still shown.
    This makes it possible to add functional "Top Level" entries
    in the Datacage

diff -r 16c14e5ab00f -r f2371f3aaf03 flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageWidget.java
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageWidget.java	Wed Mar 27 15:38:07 2013 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageWidget.java	Tue Mar 26 18:29:13 2013 +0100
@@ -405,9 +405,10 @@
                     tree.setRoot(root);
 
                     TreeNode[] nodes = tree.getChildren(root);
-                    for (int i = 0; i < nodes.length; i++) {
-                        if(!tree.hasChildren(nodes[i])) {
-                            nodes[i].setIsFolder(true);
+                    for (TreeNode node: nodes) {
+                        if (node.getAttribute("factory") == null &&
+                                !tree.hasChildren(node)) {
+                            node.setIsFolder(true);
                         }
                     }
 


More information about the Dive4elements-commits mailing list