diff flys-client/src/main/java/de/intevation/flys/client/client/ui/stationinfo/GaugeInfoPanel.java @ 4981:0e6e44e6725f

flys-client: (first draft) In GaugeInfo show link to show main values.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Thu, 14 Feb 2013 09:32:29 +0100
parents 6f6461e07854
children e2053fbcd165
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/stationinfo/GaugeInfoPanel.java	Thu Feb 14 09:29:51 2013 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/stationinfo/GaugeInfoPanel.java	Thu Feb 14 09:32:29 2013 +0100
@@ -1,10 +1,15 @@
 package de.intevation.flys.client.client.ui.stationinfo;
 
 import com.google.gwt.core.client.GWT;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
 import com.google.gwt.i18n.client.NumberFormat;
+import com.google.gwt.user.client.ui.Anchor;
 import com.google.gwt.user.client.ui.Grid;
 import com.smartgwt.client.widgets.layout.VLayout;
+import com.smartgwt.client.widgets.Label;
 
+import de.intevation.flys.client.client.FLYS;
 import de.intevation.flys.client.client.FLYSConstants;
 import de.intevation.flys.client.shared.model.GaugeInfo;
 
@@ -13,7 +18,11 @@
     /** The message class that provides i18n strings.*/
     private FLYSConstants MSG = GWT.create(FLYSConstants.class);
 
-    public GaugeInfoPanel(GaugeInfo gauge) {
+    /** Application instance. */
+    private FLYS flys;
+
+    public GaugeInfoPanel(GaugeInfo gauge, FLYS flys) {
+        this.flys = flys;
         setStyleName("gaugeinfopanel");
         setWidth100();
 
@@ -51,5 +60,33 @@
         }
 
         addMember(grid);
+        addMember(new GaugeMainValueAnchor(flys, gauge));
+    }
+
+
+    /**
+     * Clickable anchor that asks application to show window with
+     * main values for gauge.
+     */
+    class GaugeMainValueAnchor extends Anchor implements ClickHandler {
+
+        private FLYS flys;
+        private GaugeInfo gauge;
+
+        public GaugeMainValueAnchor(FLYS flys, GaugeInfo gauge) {
+            super("TODO:i18n MainVALUES");
+            // TODO i18n mainvalues
+            this.flys = flys;
+            this.gauge = gauge;
+
+            addClickHandler(this);
+        }
+
+        @Override
+        public void onClick(ClickEvent ev) {
+            GWT.log("GaugeMainValueAnchor - onClick " + gauge.getRiverName() +
+                    " " + gauge.getOfficialNumber());
+            flys.newGaugeMainValueTable(gauge);
+        }
     }
 }

http://dive4elements.wald.intevation.org