comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/DoubleArrayPanel.java @ 5195:d07abdb7ed7f

flys/issue1137: Allow value selection via inputhelpers in WQAdaptedPanel.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Fri, 08 Mar 2013 09:17:50 +0100
parents 5f70c73b11ed
children 6f23afa5323e
comparison
equal deleted inserted replaced
5194:92c8f8d1a3ba 5195:d07abdb7ed7f
7 import com.smartgwt.client.widgets.form.DynamicForm; 7 import com.smartgwt.client.widgets.form.DynamicForm;
8 import com.smartgwt.client.widgets.form.fields.FormItem; 8 import com.smartgwt.client.widgets.form.fields.FormItem;
9 import com.smartgwt.client.widgets.form.fields.StaticTextItem; 9 import com.smartgwt.client.widgets.form.fields.StaticTextItem;
10 import com.smartgwt.client.widgets.form.fields.TextItem; 10 import com.smartgwt.client.widgets.form.fields.TextItem;
11 import com.smartgwt.client.widgets.form.fields.events.BlurHandler; 11 import com.smartgwt.client.widgets.form.fields.events.BlurHandler;
12 import com.smartgwt.client.widgets.form.fields.events.FocusHandler;
12 13
13 import de.intevation.flys.client.client.FLYSConstants; 14 import de.intevation.flys.client.client.FLYSConstants;
14 15
15 import java.util.Map; 16 import java.util.Map;
16 17
31 public DoubleArrayPanel( 32 public DoubleArrayPanel(
32 String title, 33 String title,
33 double[] values, 34 double[] values,
34 BlurHandler handler) 35 BlurHandler handler)
35 { 36 {
36 this(title, values, handler, TitleOrientation.RIGHT); 37 this(title, values, handler, null, TitleOrientation.RIGHT);
37 } 38 }
38 39
39 40
40 /** 41 /**
41 * Creates a new form with a single input field that displays an array of 42 * Creates a new form with a single input field that displays an array of
42 * double values. 43 * double values.
43 * 44 *
44 * @param name The name of the TextItem. 45 * @param name The name of the TextItem.
45 * @param title The title of the TextItem. 46 * @param title The title of the TextItem.
46 * @param values The double values that should be displayed initially. 47 * @param values The double values that should be displayed initially.
47 * @param handler The BlurHandler that is used to valide the input. 48 * @param blurHandler The BlurHandler that is used to valide the input.
49 * @param focusHandler The FocueHandler that is used to valide the input.
48 */ 50 */
49 public DoubleArrayPanel( 51 public DoubleArrayPanel(
50 String title, 52 String title,
51 double[] values, 53 double[] values,
52 BlurHandler handler, 54 BlurHandler blurHandler,
55 FocusHandler focusHandler,
53 TitleOrientation titleOrientation) 56 TitleOrientation titleOrientation)
54 { 57 {
55 this.title = title; 58 this.title = title;
56 ti = new TextItem(FIELD_NAME); 59 ti = new TextItem(FIELD_NAME);
57 StaticTextItem sti = new StaticTextItem("staticarray"); 60 StaticTextItem sti = new StaticTextItem("staticarray");
58 61
59 ti.setShowTitle(false); 62 ti.setShowTitle(false);
60 sti.setShowTitle(false); 63 sti.setShowTitle(false);
61 sti.setValue(title); 64 sti.setValue(title);
62 65
63 ti.addBlurHandler(handler); 66 ti.addBlurHandler(blurHandler);
67 ti.addFocusHandler(focusHandler);
64 68
65 if (titleOrientation == TitleOrientation.RIGHT) { 69 if (titleOrientation == TitleOrientation.RIGHT) {
66 setFields(ti, sti); 70 setFields(ti, sti);
67 } 71 }
68 else { 72 else {

http://dive4elements.wald.intevation.org