Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/fixation/FixGaugeSelectPanel.java @ 3832:7d58d90d6b96
i18n
flys-client/trunk@5532 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Wed, 19 Sep 2012 21:59:54 +0000 |
parents | 0de61fc9d281 |
children |
comparison
equal
deleted
inserted
replaced
3831:dc505433173f | 3832:7d58d90d6b96 |
---|---|
1 package de.intevation.flys.client.client.ui.fixation; | 1 package de.intevation.flys.client.client.ui.fixation; |
2 | |
3 import java.util.List; | |
4 import java.util.ArrayList; | |
5 import java.util.LinkedHashMap; | |
6 | 2 |
7 import com.google.gwt.core.client.GWT; | 3 import com.google.gwt.core.client.GWT; |
8 | 4 |
9 import com.smartgwt.client.widgets.Canvas; | 5 import com.smartgwt.client.widgets.Canvas; |
10 import com.smartgwt.client.widgets.Label; | 6 import com.smartgwt.client.widgets.Label; |
11 | 7 import com.smartgwt.client.widgets.form.DynamicForm; |
8 import com.smartgwt.client.widgets.form.fields.SelectItem; | |
9 import com.smartgwt.client.widgets.form.fields.StaticTextItem; | |
12 import com.smartgwt.client.widgets.layout.HLayout; | 10 import com.smartgwt.client.widgets.layout.HLayout; |
13 import com.smartgwt.client.widgets.layout.VLayout; | 11 import com.smartgwt.client.widgets.layout.VLayout; |
14 | 12 |
15 import com.smartgwt.client.widgets.form.DynamicForm; | |
16 import com.smartgwt.client.widgets.form.fields.SelectItem; | |
17 import com.smartgwt.client.widgets.form.fields.StaticTextItem; | |
18 | |
19 import de.intevation.flys.client.client.FLYSConstants; | 13 import de.intevation.flys.client.client.FLYSConstants; |
20 | |
21 import de.intevation.flys.client.shared.model.Data; | 14 import de.intevation.flys.client.shared.model.Data; |
22 import de.intevation.flys.client.shared.model.DataItem; | 15 import de.intevation.flys.client.shared.model.DataItem; |
23 import de.intevation.flys.client.shared.model.DataList; | 16 import de.intevation.flys.client.shared.model.DataList; |
24 import de.intevation.flys.client.shared.model.DefaultData; | 17 import de.intevation.flys.client.shared.model.DefaultData; |
25 import de.intevation.flys.client.shared.model.DefaultDataItem; | 18 import de.intevation.flys.client.shared.model.DefaultDataItem; |
19 | |
20 import java.util.ArrayList; | |
21 import java.util.LinkedHashMap; | |
22 import java.util.List; | |
26 | 23 |
27 /** | 24 /** |
28 * This UIProvider creates a panel for location or distance input. | 25 * This UIProvider creates a panel for location or distance input. |
29 * | 26 * |
30 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> | 27 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> |
39 protected String second; | 36 protected String second; |
40 | 37 |
41 protected SelectItem from; | 38 protected SelectItem from; |
42 protected SelectItem to; | 39 protected SelectItem to; |
43 | 40 |
44 protected LinkedHashMap mapValues; | 41 protected LinkedHashMap<String, String> mapValues; |
45 | 42 |
46 public FixGaugeSelectPanel() { | 43 public FixGaugeSelectPanel() { |
47 htmlOverview = ""; | 44 htmlOverview = ""; |
48 // TODO: i18n | 45 |
49 mapValues = new LinkedHashMap(); | 46 mapValues = new LinkedHashMap<String, String>(); |
50 mapValues.put("0", "um MNQ"); | 47 mapValues.put("0", MESSAGES.gauge_mnq()); |
51 mapValues.put("1", "um MQ"); | 48 mapValues.put("1", MESSAGES.gauge_mq()); |
52 mapValues.put("2", "um MHQ"); | 49 mapValues.put("2", MESSAGES.gauge_mhq()); |
53 mapValues.put("3", "\u00fcber HQ5"); | 50 mapValues.put("3", MESSAGES.gauge_hq5()); |
54 } | 51 } |
55 | 52 |
53 @Override | |
56 public Canvas createWidget(DataList data) { | 54 public Canvas createWidget(DataList data) { |
57 instances.put(this.artifact.getUuid(), this); | 55 instances.put(this.artifact.getUuid(), this); |
58 | 56 |
59 VLayout layout = new VLayout(); | 57 VLayout layout = new VLayout(); |
60 | 58 |
120 /** | 118 /** |
121 * This method returns the selected data. | 119 * This method returns the selected data. |
122 * | 120 * |
123 * @return the selected/inserted data. | 121 * @return the selected/inserted data. |
124 */ | 122 */ |
123 @Override | |
125 public Data[] getData() { | 124 public Data[] getData() { |
126 List<Data> data = new ArrayList<Data>(); | 125 List<Data> data = new ArrayList<Data>(); |
127 | 126 |
128 boolean valid = saveClassValues(); | 127 boolean valid = saveClassValues(); |
129 if (valid) { | 128 if (valid) { |
155 // No selection, return false. | 154 // No selection, return false. |
156 return false; | 155 return false; |
157 } | 156 } |
158 | 157 |
159 | 158 |
159 @Override | |
160 public void success() {} | 160 public void success() {} |
161 | 161 |
162 protected boolean saveClassValues() { | 162 protected boolean saveClassValues() { |
163 String v1 = from.getValueAsString(); | 163 String v1 = from.getValueAsString(); |
164 String v2 = to.getValueAsString(); | 164 String v2 = to.getValueAsString(); |