diff gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/MeasurementStationInfoPanel.java @ 7933:900299ab8e6e

Replaced plain gwt with smartgwt components in info panels.
author Raimund Renkert <rrenkert@intevation.de>
date Tue, 17 Jun 2014 09:45:48 +0200
parents ea9eef426962
children 71144e25a6c9
line wrap: on
line diff
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/MeasurementStationInfoPanel.java	Fri Jun 13 16:34:29 2014 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/MeasurementStationInfoPanel.java	Tue Jun 17 09:45:48 2014 +0200
@@ -13,7 +13,8 @@
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.i18n.client.DateTimeFormat;
 import com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat;
-import com.google.gwt.user.client.ui.Grid;
+import com.smartgwt.client.widgets.Label;
+import com.smartgwt.client.widgets.layout.HLayout;
 import com.smartgwt.client.widgets.layout.VLayout;
 
 import org.dive4elements.river.client.client.FLYSConstants;
@@ -28,39 +29,64 @@
         setStyleName("infopanel");
         setWidth100();
 
-        Grid grid = new Grid(5, 2);
+        VLayout grid = new VLayout();
 
+        HLayout line1 = new HLayout();
         String type = station.getMeasurementType();
         if (type != null) {
-            grid.setText(0, 0, MSG.measurement_station_type());
-            grid.setText(0, 1, type);
+            Label key = new Label(MSG.measurement_station_type());
+            Label value = new Label(type);
+            key.setWidth(150);
+            line1.addMember(key);
+            line1.addMember(value);
+            grid.addMember(line1);
         }
 
+        HLayout line2 = new HLayout();
         String riverside = station.getRiverSide();
         if (riverside != null) {
-            grid.setText(1, 0, MSG.riverside());
-            grid.setText(1, 1, riverside);
+            Label key = new Label(MSG.riverside());
+            Label value = new Label(riverside);
+            key.setWidth(150);
+            line2.addMember(key);
+            line2.addMember(value);
+            grid.addMember(line2);
         }
 
+        HLayout line3 = new HLayout();
         String gaugename = station.getGaugeName();
         if (gaugename != null) {
-            grid.setText(2, 0, MSG.measurement_station_gauge_name());
-            grid.setText(2, 1, gaugename);
+            Label key = new Label(MSG.measurement_station_gauge_name());
+            Label value = new Label(gaugename);
+            key.setWidth(150);
+            line3.addMember(key);
+            line3.addMember(value);
+            grid.addMember(line3);
         }
 
+        HLayout line4 = new HLayout();
         DateTimeFormat df = DateTimeFormat.getFormat(
-                PredefinedFormat.DATE_MEDIUM);
+            PredefinedFormat.DATE_MEDIUM);
 
         Date starttime = station.getStartTime();
         if (starttime != null) {
-            grid.setText(3, 0, MSG.measurement_station_start_time());
-            grid.setText(3, 1, df.format(starttime));
+            Label key = new Label(MSG.measurement_station_start_time());
+            Label value = new Label(df.format(starttime));
+            key.setWidth(150);
+            line4.addMember(key);
+            line4.addMember(value);
+            grid.addMember(line4);
         }
 
+        HLayout line5 = new HLayout();
         String moperator = station.getOperator();
         if (moperator != null) {
-            grid.setText(4, 0, MSG.measurement_station_operator());
-            grid.setText(4, 1, moperator);
+            Label key = new Label(MSG.measurement_station_operator());
+            Label value = new Label(moperator);
+            key.setWidth(150);
+            line5.addMember(key);
+            line5.addMember(value);
+            grid.addMember(line5);
         }
 
         addMember(grid);

http://dive4elements.wald.intevation.org