Mercurial > dive4elements > river
diff flys-client/src/main/java/de/intevation/flys/client/client/ui/GaugeTimeRangePanel.java @ 4133:c722c08cf502
Merged heads.
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Mon, 15 Oct 2012 09:31:50 +0200 |
parents | f6c73ee1b7f1 360e22afb98b |
children | 03de5c424f95 |
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/GaugeTimeRangePanel.java Mon Oct 15 09:29:25 2012 +0200 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/GaugeTimeRangePanel.java Mon Oct 15 09:31:50 2012 +0200 @@ -1,13 +1,11 @@ package de.intevation.flys.client.client.ui; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - import com.google.gwt.core.client.GWT; import com.google.gwt.i18n.client.DateTimeFormat; + import com.smartgwt.client.data.Record; import com.smartgwt.client.types.ListGridFieldType; +import com.smartgwt.client.util.SC; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.Label; import com.smartgwt.client.widgets.form.DynamicForm; @@ -31,11 +29,17 @@ import de.intevation.flys.client.shared.model.LongRangeData; import de.intevation.flys.client.shared.model.RangeData; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + /** * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> */ public class GaugeTimeRangePanel extends RangePanel { + private static final long serialVersionUID = -157571967010594739L; + /** The message class that provides i18n strings. */ protected FLYSConstants MESSAGES = GWT.create(FLYSConstants.class); @@ -72,7 +76,6 @@ this.maxLower = maxLower; } - public Canvas create(DataList data) { setDataName(data); @@ -126,6 +129,8 @@ Date dl = new Date((Long)((LongRangeData)data).getLower()); Date du = new Date((Long)((LongRangeData)data).getUpper()); + + @SuppressWarnings("deprecation") DateTimeFormat dtf = DateTimeFormat.getMediumDateFormat(); Label value = new Label(dtf.format(dl) + " - " + dtf.format(du)); value.setHeight(20); @@ -196,7 +201,7 @@ } catch (NumberFormatException nfe) { GWT.log("could not parse lower date."); - //TODO: Messagebox with error. + SC.warn(MESSAGES.warning_cannot_parse_date()); } } @@ -209,7 +214,7 @@ } catch (NumberFormatException nfe) { GWT.log("could not parse upper date."); - //TODO: Messagebox with error. + SC.warn(MESSAGES.warning_cannot_parse_date()); } } @@ -221,6 +226,7 @@ long value = Long.valueOf(raw); Date date = new Date(value); + @SuppressWarnings("deprecation") DateTimeFormat dtf = DateTimeFormat.getMediumDateFormat(); return dtf.format(date); @@ -238,6 +244,7 @@ yearTable.setCanReorderFields(false); CellFormatter cf = new CellFormatter() { + @Override public String format( Object value, ListGridRecord record, @@ -264,6 +271,7 @@ addstart.setWidth (20); addstart.setCellIcon(baseUrl + MESSAGES.markerGreen()); addstart.addRecordClickHandler(new RecordClickHandler() { + @Override public void onRecordClick(RecordClickEvent e) { Record r = e.getRecord(); if (r.getAttribute("start").equals("-1")) { @@ -280,6 +288,7 @@ addend.setWidth (20); addend.setCellIcon(baseUrl + MESSAGES.markerRed()); addend.addRecordClickHandler(new RecordClickHandler() { + @Override public void onRecordClick(RecordClickEvent e) { Record r = e.getRecord(); if (r.getAttribute("end").equals("-1")) {