Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/stationinfo/MeasurementStationInfoPanel.java @ 4962:6f6461e07854
Move classes to its own java file
author | Björn Ricks <bjoern.ricks@intevation.de> |
---|---|
date | Mon, 04 Feb 2013 14:56:41 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
4961:27b4d5d20dc8 | 4962:6f6461e07854 |
---|---|
1 package de.intevation.flys.client.client.ui.stationinfo; | |
2 | |
3 import java.util.Date; | |
4 | |
5 import com.google.gwt.core.client.GWT; | |
6 import com.google.gwt.i18n.client.DateTimeFormat; | |
7 import com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat; | |
8 import com.google.gwt.user.client.ui.Grid; | |
9 import com.smartgwt.client.widgets.layout.VLayout; | |
10 | |
11 import de.intevation.flys.client.client.FLYSConstants; | |
12 import de.intevation.flys.client.shared.model.MeasurementStation; | |
13 | |
14 public class MeasurementStationInfoPanel extends VLayout { | |
15 | |
16 /** The message class that provides i18n strings.*/ | |
17 private FLYSConstants MSG = GWT.create(FLYSConstants.class); | |
18 | |
19 public MeasurementStationInfoPanel(MeasurementStation station) { | |
20 setStyleName("infopanel"); | |
21 setWidth100(); | |
22 | |
23 Grid grid = new Grid(5, 2); | |
24 | |
25 String type = station.getMeasurementType(); | |
26 if (type != null) { | |
27 grid.setText(0, 0, MSG.measurement_station_type()); | |
28 grid.setText(0, 1, type); | |
29 } | |
30 | |
31 String riverside = station.getRiverSide(); | |
32 if (riverside != null) { | |
33 grid.setText(1, 0, MSG.riverside()); | |
34 grid.setText(1, 1, riverside); | |
35 } | |
36 | |
37 String gaugename = station.getGaugeName(); | |
38 if (gaugename != null) { | |
39 grid.setText(2, 0, MSG.measurement_station_gauge_name()); | |
40 grid.setText(2, 1, gaugename); | |
41 } | |
42 | |
43 DateTimeFormat df = DateTimeFormat.getFormat( | |
44 PredefinedFormat.DATE_MEDIUM); | |
45 | |
46 Date starttime = station.getStartTime(); | |
47 if (starttime != null) { | |
48 grid.setText(3, 0, MSG.measurement_station_start_time()); | |
49 grid.setText(3, 1, df.format(starttime)); | |
50 } | |
51 | |
52 String moperator = station.getOperator(); | |
53 if (moperator != null) { | |
54 grid.setText(4, 0, MSG.measurement_station_operator()); | |
55 grid.setText(4, 1, moperator); | |
56 } | |
57 | |
58 addMember(grid); | |
59 } | |
60 } |