changeset 3369:20688790f0c0

Read default value of Data item and set textfield of DoubleInputPanel if a default value is existing. flys-client/trunk@5060 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 19 Jul 2012 11:48:41 +0000 (2012-07-19)
parents bf080e932d54
children 08b2472111aa
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/DoubleInputPanel.java
diffstat 2 files changed, 16 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Thu Jul 19 09:00:42 2012 +0000
+++ b/flys-client/ChangeLog	Thu Jul 19 11:48:41 2012 +0000
@@ -1,3 +1,9 @@
+2012-07-19  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/client/ui/DoubleInputPanel.java:
+	  Read default value from Data item; set textfield to this value of a
+	  default value is existing.
+
 2012-07-19	Sascha L. Teichmann	<sascha.teichmann@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/DoubleInputPanel.java	Thu Jul 19 09:00:42 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/DoubleInputPanel.java	Thu Jul 19 11:48:41 2012 +0000
@@ -1,32 +1,25 @@
 package de.intevation.flys.client.client.ui;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import com.google.gwt.core.client.GWT;
-
 import com.google.gwt.i18n.client.NumberFormat;
-
 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;
-
 import com.smartgwt.client.widgets.form.fields.TextItem;
-
 import com.smartgwt.client.widgets.layout.HLayout;
 import com.smartgwt.client.widgets.layout.VLayout;
 
 import de.intevation.flys.client.client.FLYSConstants;
-
 import de.intevation.flys.client.shared.model.Data;
 import de.intevation.flys.client.shared.model.DataItem;
 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 java.util.ArrayList;
-import java.util.List;
-
 /**
  * This UIProvider creates a panel for location or distance input.
  *
@@ -67,10 +60,17 @@
         Label title = new Label(data.get(0).getDescription());
         title.setHeight("25px");
 
+        DataItem defaultItem = data.get(0).getDefault();
+
         DynamicForm form = new DynamicForm();
         inputPanel = new TextItem();
         inputPanel.setTitle("outliers");
         inputPanel.setShowTitle(false);
+
+        if (defaultItem != null) {
+            inputPanel.setValue(defaultItem.getStringValue());
+        }
+
         form.setFields(inputPanel);
 
         layout.addMember(title);

http://dive4elements.wald.intevation.org