diff gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/MeasurementStationPanel.java @ 5838:5aa05a7a34b7

Rename modules to more fitting names.
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 25 Apr 2013 15:23:37 +0200
parents flys-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/MeasurementStationPanel.java@821a02bbfb4e
children 172338b1407f
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/MeasurementStationPanel.java	Thu Apr 25 15:23:37 2013 +0200
@@ -0,0 +1,56 @@
+package org.dive4elements.river.client.client.ui.stationinfo;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import org.dive4elements.river.client.client.FLYS;
+import org.dive4elements.river.client.shared.model.RiverInfo;
+
+/**
+ * A Panel to show info about the MeasurementStations of a river
+ *
+ * @author <a href="mailto:bjoern.ricks@intevation.de">Björn Ricks</a>
+ */
+public class MeasurementStationPanel extends InfoPanel {
+
+    /**
+     * MeasurementStationPanel loads the MeasurementStations from the
+     * RiverInfoService and displays them in a tree underneath a RiverInfoPanel
+     *
+     * @param flys The FLYS object
+     */
+    public MeasurementStationPanel(FLYS flys) {
+        super(new MeasurementStationListGrid(flys));
+    }
+
+    /**
+     * Returns the title which should be displayed in the section
+     */
+    @Override
+    public String getSectionTitle() {
+        return MSG.measurementStationPanelTitle();
+    }
+
+    /**
+     * Loads the river info and renders it afterwards
+     */
+    @Override
+    public void refresh() {
+        GWT.log("MeasurementStationPanel - refresh");
+        contract();
+
+        riverInfoService.getMeasurementStations(this.river,
+            new AsyncCallback<RiverInfo>() {
+                @Override
+                public void onFailure(Throwable e) {
+                    GWT.log("Could not load the river info." + e);
+                }
+
+                @Override
+                public void onSuccess(RiverInfo riverinfo) {
+                    GWT.log("MeasurementStationPanel - Loaded river info");
+                    render(riverinfo);
+                    expand();
+                }
+        });
+    }
+}

http://dive4elements.wald.intevation.org