changeset 3844:7a096ec98596

Open gauge tree fold for historicalq reference too flys-client/trunk@5561 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Bjoern Ricks <bjoern.ricks@intevation.de>
date Fri, 21 Sep 2012 14:21:05 +0000
parents 8e169e4e1b57
children 9d0ea03a8e9e
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/GaugeTree.java
diffstat 2 files changed, 28 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Fri Sep 21 14:12:41 2012 +0000
+++ b/flys-client/ChangeLog	Fri Sep 21 14:21:05 2012 +0000
@@ -1,3 +1,8 @@
+2012-09-21	Björn Ricks	<bjoern.ricks@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/client/ui/GaugeTree.java:
+	  Open fold for historicalq reference.
+
 2012-09-21	Björn Ricks	<bjoern.ricks@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/server/GaugeOverviewInfoServiceImpl.java,
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/GaugeTree.java	Fri Sep 21 14:12:41 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/GaugeTree.java	Fri Sep 21 14:21:05 2012 +0000
@@ -174,9 +174,10 @@
                         if (label.equals("reference_gauge")) {
                             String tmp = d.getStringValue();
                             if (tmp != null) {
-                                Integer gaugereference = Integer.valueOf(tmp);
+                                Long gaugereference = Long.valueOf(tmp);
                                 if (gaugereference != null) {
-                                    //TODO
+                                    openOnReference(gaugereference);
+                                    return;
                                 }
                             }
                         }
@@ -236,6 +237,22 @@
         return null;
     }
 
+    public void openOnReference(Long number) {
+        GWT.log("GaugeTree - openOnReference " + number);
+        for (Iterator<TreeItem> it = tree.treeItemIterator(); it.hasNext();) {
+            TreeItem item = it.next();
+            if (item instanceof GaugeInfoItem) {
+                GaugeInfoItem gitem = (GaugeInfoItem)item;
+                if (gitem.getReference().equals(number)) {
+                    item.setState(true);
+                }
+                else {
+                    item.setState(false);
+                }
+            }
+        }
+    }
+
     public void openOnDistance(Double start, Double end) {
         GWT.log("GaugeTree - openOnDistance " + start + " " + end + " " +
                 tree.getItemCount());
@@ -313,6 +330,10 @@
         public Double getEnd() {
             return gauge.getKmEnd();
         }
+
+        public Long getReference() {
+            return gauge.getOfficialNumber();
+        }
     }
 
     class GaugeInfoHead extends HLayout {

http://dive4elements.wald.intevation.org