diff gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/MeasurementStationInfoPanel.java @ 8417:71144e25a6c9

Add comment to measurement stations info.
author Tom Gottfried <tom@intevation.de>
date Thu, 16 Oct 2014 13:39:22 +0200
parents 900299ab8e6e
children
line wrap: on
line diff
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/MeasurementStationInfoPanel.java	Thu Oct 16 11:15:09 2014 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/MeasurementStationInfoPanel.java	Thu Oct 16 13:39:22 2014 +0200
@@ -25,6 +25,8 @@
     /** The message class that provides i18n strings.*/
     private FLYSConstants MSG = GWT.create(FLYSConstants.class);
 
+    private static final int KEY_WIDTH = 150;
+
     public MeasurementStationInfoPanel(MeasurementStation station) {
         setStyleName("infopanel");
         setWidth100();
@@ -36,7 +38,7 @@
         if (type != null) {
             Label key = new Label(MSG.measurement_station_type());
             Label value = new Label(type);
-            key.setWidth(150);
+            key.setWidth(KEY_WIDTH);
             line1.addMember(key);
             line1.addMember(value);
             grid.addMember(line1);
@@ -47,7 +49,7 @@
         if (riverside != null) {
             Label key = new Label(MSG.riverside());
             Label value = new Label(riverside);
-            key.setWidth(150);
+            key.setWidth(KEY_WIDTH);
             line2.addMember(key);
             line2.addMember(value);
             grid.addMember(line2);
@@ -58,7 +60,7 @@
         if (gaugename != null) {
             Label key = new Label(MSG.measurement_station_gauge_name());
             Label value = new Label(gaugename);
-            key.setWidth(150);
+            key.setWidth(KEY_WIDTH);
             line3.addMember(key);
             line3.addMember(value);
             grid.addMember(line3);
@@ -72,7 +74,7 @@
         if (starttime != null) {
             Label key = new Label(MSG.measurement_station_start_time());
             Label value = new Label(df.format(starttime));
-            key.setWidth(150);
+            key.setWidth(KEY_WIDTH);
             line4.addMember(key);
             line4.addMember(value);
             grid.addMember(line4);
@@ -83,12 +85,24 @@
         if (moperator != null) {
             Label key = new Label(MSG.measurement_station_operator());
             Label value = new Label(moperator);
-            key.setWidth(150);
+            key.setWidth(KEY_WIDTH);
             line5.addMember(key);
             line5.addMember(value);
             grid.addMember(line5);
         }
 
+        HLayout line6 = new HLayout();
+        String mcomment = station.getComment();
+        if (mcomment != null) {
+            Label key = new Label(MSG.measurement_station_comment());
+            Label value = new Label(mcomment);
+            key.setWidth(KEY_WIDTH);
+            value.setWidth(300);
+            line6.addMember(key);
+            line6.addMember(value);
+            grid.addMember(line6);
+        }
+
         addMember(grid);
     }
 }

http://dive4elements.wald.intevation.org