changeset 5462:f2371f3aaf03

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
author Andre Heinecke <aheinecke@intevation.de>
date Tue, 26 Mar 2013 18:29:13 +0100
parents 16c14e5ab00f
children 1aedf4c0ac28
files flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageWidget.java
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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);
                         }
                     }
 

http://dive4elements.wald.intevation.org