Mercurial > dive4elements > river
view flys-client/src/main/java/de/intevation/flys/client/client/ui/stationinfo/MeasurementStationInfoPanel.java @ 5640:4bd444837cdd
Doc.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 10 Apr 2013 09:28:58 +0200 |
parents | 6f6461e07854 |
children |
line wrap: on
line source
package de.intevation.flys.client.client.ui.stationinfo; import java.util.Date; 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.layout.VLayout; import de.intevation.flys.client.client.FLYSConstants; import de.intevation.flys.client.shared.model.MeasurementStation; public class MeasurementStationInfoPanel extends VLayout { /** The message class that provides i18n strings.*/ private FLYSConstants MSG = GWT.create(FLYSConstants.class); public MeasurementStationInfoPanel(MeasurementStation station) { setStyleName("infopanel"); setWidth100(); Grid grid = new Grid(5, 2); String type = station.getMeasurementType(); if (type != null) { grid.setText(0, 0, MSG.measurement_station_type()); grid.setText(0, 1, type); } String riverside = station.getRiverSide(); if (riverside != null) { grid.setText(1, 0, MSG.riverside()); grid.setText(1, 1, riverside); } String gaugename = station.getGaugeName(); if (gaugename != null) { grid.setText(2, 0, MSG.measurement_station_gauge_name()); grid.setText(2, 1, gaugename); } DateTimeFormat df = DateTimeFormat.getFormat( 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)); } String moperator = station.getOperator(); if (moperator != null) { grid.setText(4, 0, MSG.measurement_station_operator()); grid.setText(4, 1, moperator); } addMember(grid); } }