Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/DoubleArrayPanel.java @ 4131:360e22afb98b
Cosmetics, warnings and minor TODOs.
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Mon, 15 Oct 2012 00:04:35 +0200 |
parents | 06c76de19b51 |
children | 5f70c73b11ed |
comparison
equal
deleted
inserted
replaced
4130:df8ac7ff6b1a | 4131:360e22afb98b |
---|---|
1 package de.intevation.flys.client.client.ui; | 1 package de.intevation.flys.client.client.ui; |
2 | |
3 import java.util.Map; | |
4 | 2 |
5 import com.google.gwt.core.client.GWT; | 3 import com.google.gwt.core.client.GWT; |
6 import com.google.gwt.i18n.client.NumberFormat; | 4 import com.google.gwt.i18n.client.NumberFormat; |
7 | 5 |
8 import com.smartgwt.client.types.TitleOrientation; | 6 import com.smartgwt.client.types.TitleOrientation; |
11 import com.smartgwt.client.widgets.form.fields.StaticTextItem; | 9 import com.smartgwt.client.widgets.form.fields.StaticTextItem; |
12 import com.smartgwt.client.widgets.form.fields.TextItem; | 10 import com.smartgwt.client.widgets.form.fields.TextItem; |
13 import com.smartgwt.client.widgets.form.fields.events.BlurHandler; | 11 import com.smartgwt.client.widgets.form.fields.events.BlurHandler; |
14 | 12 |
15 import de.intevation.flys.client.client.FLYSConstants; | 13 import de.intevation.flys.client.client.FLYSConstants; |
14 | |
15 import java.util.Map; | |
16 | 16 |
17 public class DoubleArrayPanel | 17 public class DoubleArrayPanel |
18 extends DynamicForm | 18 extends DynamicForm |
19 { | 19 { |
20 /** The message class that provides i18n strings. */ | 20 /** The message class that provides i18n strings. */ |
154 * there are values that doesn't represent a valid location, an error is | 154 * there are values that doesn't represent a valid location, an error is |
155 * displayed. | 155 * displayed. |
156 * | 156 * |
157 * @param item The FormItem. | 157 * @param item The FormItem. |
158 */ | 158 */ |
159 @SuppressWarnings("unchecked") | |
159 protected boolean validateForm(FormItem item) { | 160 protected boolean validateForm(FormItem item) { |
160 if (item instanceof StaticTextItem) { | 161 if (item instanceof StaticTextItem) { |
161 return true; | 162 return true; |
162 } | 163 } |
163 | 164 |
172 | 173 |
173 if (parts == null) { | 174 if (parts == null) { |
174 return valid; | 175 return valid; |
175 } | 176 } |
176 | 177 |
177 NumberFormat f = NumberFormat.getDecimalFormat(); | 178 NumberFormat nf = NumberFormat.getDecimalFormat(); |
178 Map errors = getErrors(); | 179 @SuppressWarnings("rawtypes") |
180 Map errors = getErrors(); | |
179 | 181 |
180 try { | 182 try { |
181 for (String part: parts) { | 183 for (String part: parts) { |
182 | 184 |
183 if (part.length() == 0) { | 185 if (part.length() == 0) { |
184 continue; | 186 continue; |
185 } | 187 } |
186 | 188 |
187 double location = f.parse(part); | 189 nf.parse(part); |
188 } | 190 } |
189 | 191 |
190 errors.remove(item.getFieldName()); | 192 errors.remove(item.getFieldName()); |
191 } | 193 } |
192 catch (NumberFormatException nfe) { | 194 catch (NumberFormatException nfe) { |