Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ManualWSPEditor.java @ 2928:f0c7c52203c0
Minor Manual WSP editor polish.
flys-client/trunk@4829 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Thu, 28 Jun 2012 15:33:08 +0000 |
parents | f978058dc835 |
children | 0ef4753e5515 |
comparison
equal
deleted
inserted
replaced
2927:f978058dc835 | 2928:f0c7c52203c0 |
---|---|
1 package de.intevation.flys.client.client.ui.chart; | 1 package de.intevation.flys.client.client.ui.chart; |
2 | 2 |
3 import java.util.List; | 3 import java.util.List; |
4 import java.util.Map; | |
4 | 5 |
5 import com.google.gwt.json.client.JSONArray; | 6 import com.google.gwt.json.client.JSONArray; |
6 import com.google.gwt.json.client.JSONNumber; | 7 import com.google.gwt.json.client.JSONNumber; |
7 import com.google.gwt.json.client.JSONParser; | 8 import com.google.gwt.json.client.JSONParser; |
8 import com.google.gwt.json.client.JSONString; | 9 import com.google.gwt.json.client.JSONString; |
16 import com.smartgwt.client.widgets.IButton; | 17 import com.smartgwt.client.widgets.IButton; |
17 import com.smartgwt.client.widgets.Button; | 18 import com.smartgwt.client.widgets.Button; |
18 import com.smartgwt.client.widgets.Label; | 19 import com.smartgwt.client.widgets.Label; |
19 import com.google.gwt.i18n.client.NumberFormat; | 20 import com.google.gwt.i18n.client.NumberFormat; |
20 | 21 |
21 import com.smartgwt.client.widgets.grid.CellEditValueParser; | 22 import com.smartgwt.client.widgets.form.fields.events.BlurHandler; |
22 import com.smartgwt.client.widgets.grid.CellEditValueFormatter; | 23 import com.smartgwt.client.widgets.form.fields.events.BlurEvent; |
24 | |
23 import com.smartgwt.client.widgets.events.ClickEvent; | 25 import com.smartgwt.client.widgets.events.ClickEvent; |
24 import com.smartgwt.client.widgets.events.ClickHandler; | 26 import com.smartgwt.client.widgets.events.ClickHandler; |
25 | 27 |
26 import com.smartgwt.client.types.Alignment; | 28 import com.smartgwt.client.types.Alignment; |
27 | 29 |
50 import de.intevation.flys.client.client.event.RedrawRequestEvent; | 52 import de.intevation.flys.client.client.event.RedrawRequestEvent; |
51 | 53 |
52 import com.smartgwt.client.widgets.form.DynamicForm; | 54 import com.smartgwt.client.widgets.form.DynamicForm; |
53 import com.smartgwt.client.widgets.form.fields.FormItem; | 55 import com.smartgwt.client.widgets.form.fields.FormItem; |
54 import com.smartgwt.client.widgets.form.fields.TextItem; | 56 import com.smartgwt.client.widgets.form.fields.TextItem; |
57 import de.intevation.flys.client.client.utils.DoubleValidator; | |
55 | 58 |
56 | 59 |
57 /** | 60 /** |
58 * UI to enter point data and save it to an PointArtifact. | 61 * UI to enter point data and save it to an PointArtifact. |
59 */ | 62 */ |
191 | 194 |
192 DynamicForm form = new DynamicForm(); | 195 DynamicForm form = new DynamicForm(); |
193 valueInputPanel = new TextItem(); | 196 valueInputPanel = new TextItem(); |
194 valueInputPanel.setTitle(yAxis); | 197 valueInputPanel.setTitle(yAxis); |
195 valueInputPanel.setShowTitle(true); | 198 valueInputPanel.setShowTitle(true); |
199 valueInputPanel.addBlurHandler(new BlurHandler() { | |
200 public void onBlur(BlurEvent e) { | |
201 DoubleValidator validator = new DoubleValidator(); | |
202 Map errors = e.getForm().getErrors(); | |
203 if(validator.validate(e.getItem(), errors)) { | |
204 e.getForm().setErrors(errors, true); | |
205 } | |
206 else { | |
207 e.getForm().setErrors(errors, true); | |
208 } | |
209 } | |
210 }); | |
196 nameInputPanel = new TextItem(); | 211 nameInputPanel = new TextItem(); |
197 nameInputPanel.setTitle(MSG.pointname()); | 212 nameInputPanel.setTitle(MSG.pointname()); |
198 nameInputPanel.setShowTitle(true); | 213 nameInputPanel.setShowTitle(true); |
199 form.setFields(valueInputPanel, nameInputPanel); | 214 form.setFields(valueInputPanel, nameInputPanel); |
200 | 215 |
311 /** Add a ManualPointArtifact to Collection. */ | 326 /** Add a ManualPointArtifact to Collection. */ |
312 public void addArtifactCreateUI() { | 327 public void addArtifactCreateUI() { |
313 final Label standByLabel = new Label(MSG.standby()); | 328 final Label standByLabel = new Label(MSG.standby()); |
314 addItem(standByLabel); | 329 addItem(standByLabel); |
315 | 330 |
316 setWidth(380); | 331 setWidth(360); |
317 setHeight(470); | 332 setHeight(120); |
318 centerInPage(); | 333 centerInPage(); |
319 | 334 |
320 Config config = Config.getInstance(); | 335 Config config = Config.getInstance(); |
321 String locale = config.getLocale(); | 336 String locale = config.getLocale(); |
322 | 337 |
350 | 365 |
351 /** Return false if x or y attribute is missing. */ | 366 /** Return false if x or y attribute is missing. */ |
352 protected boolean isDialogValid() { | 367 protected boolean isDialogValid() { |
353 boolean valid = true; | 368 boolean valid = true; |
354 // TODO implement | 369 // TODO implement |
370 // | |
355 return valid; | 371 return valid; |
356 } | 372 } |
357 } | 373 } |
358 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 374 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |