changeset 2886:bd16493cc0da

Set initial values for start and end date in fix analysis date panels. flys-client/trunk@4569 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 01 Jun 2012 10:49:10 +0000
parents 6ab6025cef20
children 12f58f719125
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/fixation/FixPeriodPanel.java
diffstat 2 files changed, 21 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Fri Jun 01 10:47:34 2012 +0000
+++ b/flys-client/ChangeLog	Fri Jun 01 10:49:10 2012 +0000
@@ -1,3 +1,8 @@
+2012-06-01  Raimund Renkert <raimund.renkert@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/client/ui/fixation/FixPeriodPanel.java:
+	  Set initial values for start and end date.
+
 2012-06-01  Raimund Renkert <raimund.renkert@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/shared/model/FixAnalysisArtifact.java,
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/fixation/FixPeriodPanel.java	Fri Jun 01 10:47:34 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/fixation/FixPeriodPanel.java	Fri Jun 01 10:49:10 2012 +0000
@@ -3,6 +3,8 @@
 import java.util.List;
 import java.util.ArrayList;
 import java.util.Date;
+import java.text.DateFormat;
+import java.text.ParseException;
 
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.i18n.client.DateTimeFormat;
@@ -26,6 +28,7 @@
 import de.intevation.flys.client.shared.model.DataList;
 import de.intevation.flys.client.shared.model.DefaultData;
 import de.intevation.flys.client.shared.model.DefaultDataItem;
+import de.intevation.flys.client.shared.model.FixingsOverviewInfo.FixEvent;
 
 /**
  * This UIProvider creates a panel for location or distance input.
@@ -170,7 +173,19 @@
     }
 
 
-    public void success() {}
+    public void success() {
+        List<FixEvent> list = fixInfo.getEvents();
+        DateFormat df = DateFormat.getDateInstance();
+        try {
+            Date f = df.parse(list.get(0).getDate());
+            Date t = df.parse(list.get(list.size() - 1).getDate());
+            this.inputPanel.setFromDate(f);
+            this.inputPanel.setToDate(t);
+        }
+        catch(ParseException pe) {
+            GWT.log(pe.toString());
+        }
+    }
 
     protected boolean saveDateValues() {
         Date st = inputPanel.getFromDate();

http://dive4elements.wald.intevation.org