Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/DoubleInputPanel.java @ 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 |
parents | 93302bd16f42 |
children | 0de61fc9d281 |
comparison
equal
deleted
inserted
replaced
3368:bf080e932d54 | 3369:20688790f0c0 |
---|---|
1 package de.intevation.flys.client.client.ui; | 1 package de.intevation.flys.client.client.ui; |
2 | 2 |
3 import java.util.ArrayList; | |
4 import java.util.List; | |
5 | |
3 import com.google.gwt.core.client.GWT; | 6 import com.google.gwt.core.client.GWT; |
4 | |
5 import com.google.gwt.i18n.client.NumberFormat; | 7 import com.google.gwt.i18n.client.NumberFormat; |
6 | |
7 import com.smartgwt.client.util.SC; | 8 import com.smartgwt.client.util.SC; |
8 | |
9 import com.smartgwt.client.widgets.Canvas; | 9 import com.smartgwt.client.widgets.Canvas; |
10 import com.smartgwt.client.widgets.Label; | 10 import com.smartgwt.client.widgets.Label; |
11 | |
12 import com.smartgwt.client.widgets.form.DynamicForm; | 11 import com.smartgwt.client.widgets.form.DynamicForm; |
13 | |
14 import com.smartgwt.client.widgets.form.fields.TextItem; | 12 import com.smartgwt.client.widgets.form.fields.TextItem; |
15 | |
16 import com.smartgwt.client.widgets.layout.HLayout; | 13 import com.smartgwt.client.widgets.layout.HLayout; |
17 import com.smartgwt.client.widgets.layout.VLayout; | 14 import com.smartgwt.client.widgets.layout.VLayout; |
18 | 15 |
19 import de.intevation.flys.client.client.FLYSConstants; | 16 import de.intevation.flys.client.client.FLYSConstants; |
20 | |
21 import de.intevation.flys.client.shared.model.Data; | 17 import de.intevation.flys.client.shared.model.Data; |
22 import de.intevation.flys.client.shared.model.DataItem; | 18 import de.intevation.flys.client.shared.model.DataItem; |
23 import de.intevation.flys.client.shared.model.DataList; | 19 import de.intevation.flys.client.shared.model.DataList; |
24 import de.intevation.flys.client.shared.model.DefaultData; | 20 import de.intevation.flys.client.shared.model.DefaultData; |
25 import de.intevation.flys.client.shared.model.DefaultDataItem; | 21 import de.intevation.flys.client.shared.model.DefaultDataItem; |
26 | |
27 import java.util.ArrayList; | |
28 import java.util.List; | |
29 | 22 |
30 /** | 23 /** |
31 * This UIProvider creates a panel for location or distance input. | 24 * This UIProvider creates a panel for location or distance input. |
32 * | 25 * |
33 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> | 26 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> |
65 VLayout layout = new VLayout(); | 58 VLayout layout = new VLayout(); |
66 | 59 |
67 Label title = new Label(data.get(0).getDescription()); | 60 Label title = new Label(data.get(0).getDescription()); |
68 title.setHeight("25px"); | 61 title.setHeight("25px"); |
69 | 62 |
63 DataItem defaultItem = data.get(0).getDefault(); | |
64 | |
70 DynamicForm form = new DynamicForm(); | 65 DynamicForm form = new DynamicForm(); |
71 inputPanel = new TextItem(); | 66 inputPanel = new TextItem(); |
72 inputPanel.setTitle("outliers"); | 67 inputPanel.setTitle("outliers"); |
73 inputPanel.setShowTitle(false); | 68 inputPanel.setShowTitle(false); |
69 | |
70 if (defaultItem != null) { | |
71 inputPanel.setValue(defaultItem.getStringValue()); | |
72 } | |
73 | |
74 form.setFields(inputPanel); | 74 form.setFields(inputPanel); |
75 | 75 |
76 layout.addMember(title); | 76 layout.addMember(title); |
77 layout.addMember(form); | 77 layout.addMember(form); |
78 | 78 |