changeset 9275:ff9372d0cc1c

All gauges should be collapsed during selection of calc mode
author gernotbelger
date Thu, 19 Jul 2018 17:36:52 +0200
parents 1c8eeaf6031f
children 3141f0e7314e
files gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/GaugeListGrid.java
diffstat 1 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/GaugeListGrid.java	Thu Jul 19 17:33:24 2018 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/GaugeListGrid.java	Thu Jul 19 17:36:52 2018 +0200
@@ -210,7 +210,11 @@
         }
         if (!locations.isEmpty()) {
             openOnLocations(locations);
-        } else {
+        } else if( this.data != null && this.data.length == 1 ){
+            // During selection of calc-mode: all gauges should be collapsed
+            collapseAll();
+        }
+        else {
             openAll();
         }
     }
@@ -226,6 +230,16 @@
         }
     }
 
+    private void collapseAll() {
+        
+        GWT.log("InfoListGrid - openAll");
+        
+        setData(new ListGridRecord[] {});
+        for (final GaugeInfo gauge : this.gauges) {
+            addCollapsedRecord(gauge);
+        }
+    }
+
     void getLocations(final String labelname, final List<Double> locations, final DataList dl) {
         for (int j = dl.size() - 1; j >= 0; --j) {
             final Data d = dl.get(j);

http://dive4elements.wald.intevation.org