Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/ModuleSelection.java @ 3530:8c9c202292fe
Set the default value of the RadioGroupItem if a loaded module is selected
flys-client/trunk@5333 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Bjoern Ricks <bjoern.ricks@intevation.de> |
---|---|
date | Fri, 31 Aug 2012 13:29:26 +0000 |
parents | 33ed40aa1201 |
children | 360e22afb98b |
comparison
equal
deleted
inserted
replaced
3529:72d2ec6a471e | 3530:8c9c202292fe |
---|---|
36 */ | 36 */ |
37 public class ModuleSelection extends MapSelection { | 37 public class ModuleSelection extends MapSelection { |
38 | 38 |
39 /** The message class that provides i18n strings.*/ | 39 /** The message class that provides i18n strings.*/ |
40 protected FLYSConstants MESSAGES = GWT.create(FLYSConstants.class); | 40 protected FLYSConstants MESSAGES = GWT.create(FLYSConstants.class); |
41 | |
42 | |
43 /** Constant field name for the plugin selection.*/ | |
44 public static final String FIELD_PLUGIN = "plugin"; | |
45 | |
46 /** Constant value for the WINFO plugin.*/ | |
47 public static final String FIELD_PLUGIN_WINFO = "winfo"; | |
48 | |
49 /** Constant value for the MINFO plugin.*/ | |
50 public static final String FIELD_PLUGIN_MINFO = "minfo"; | |
51 | |
52 /** Constant value for the MAP plugin.*/ | |
53 public static final String FIELD_PLUGIN_MAP = "new_map"; | |
54 | |
55 /** Constant value for the CHART plugin.*/ | |
56 public static final String FIELD_PLUGIN_CHART = "new_chart"; | |
57 | |
58 /** Constant value for the FIX plugin.*/ | |
59 public static final String FIELD_PLUGIN_FIX = "fixanalysis"; | |
60 | |
61 | 41 |
62 /** The module checkboxes.*/ | 42 /** The module checkboxes.*/ |
63 protected RadioGroupItem radio; | 43 protected RadioGroupItem radio; |
64 | 44 |
65 /** */ | 45 /** */ |
119 }); | 99 }); |
120 } | 100 } |
121 | 101 |
122 private void setModules() { | 102 private void setModules() { |
123 LinkedHashMap values = new LinkedHashMap(); | 103 LinkedHashMap values = new LinkedHashMap(); |
104 | |
124 if (this.modules!= null) { | 105 if (this.modules!= null) { |
125 for(Module module : this.modules) { | 106 for(Module module : this.modules) { |
126 values.put(module.getName(), module.getLocalizedName()); | 107 values.put(module.getName(), module.getLocalizedName()); |
108 if (module.isSelected()) { | |
109 GWT.log("Module " + module.getName() + " is selected."); | |
110 if (radio != null) { | |
111 radio.setDefaultValue(module.getName()); | |
112 GWT.log("Setting " + module.getName() + " as selected."); | |
113 } | |
114 } | |
127 } | 115 } |
128 } | 116 } |
129 if (radio != null) { | 117 if (radio != null) { |
130 radio.setValueMap(values); | 118 radio.setValueMap(values); |
131 } | 119 } |
151 radio.setShowTitle(false); | 139 radio.setShowTitle(false); |
152 radio.setVertical(true); | 140 radio.setVertical(true); |
153 | 141 |
154 setModules(); | 142 setModules(); |
155 | 143 |
156 /* LinkedHashMap initial = new LinkedHashMap(); */ | |
157 /* initial.put(FIELD_PLUGIN, FIELD_PLUGIN_WINFO); */ | |
158 | |
159 form.setFields(radio); | 144 form.setFields(radio); |
160 /* form.setValues(initial); */ | |
161 | 145 |
162 layout.addMember(label); | 146 layout.addMember(label); |
163 layout.addMember(form); | 147 layout.addMember(form); |
164 | 148 |
165 return layout; | 149 return layout; |