Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/ModuleSelection.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 | 8c9c202292fe |
children | 2aabd9752d5e |
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.LinkedHashMap; | |
4 | 2 |
5 import com.google.gwt.core.client.GWT; | 3 import com.google.gwt.core.client.GWT; |
6 import com.google.gwt.user.client.rpc.AsyncCallback; | 4 import com.google.gwt.user.client.rpc.AsyncCallback; |
7 | 5 |
8 import com.smartgwt.client.types.VerticalAlignment; | 6 import com.smartgwt.client.types.VerticalAlignment; |
12 import com.smartgwt.client.widgets.form.DynamicForm; | 10 import com.smartgwt.client.widgets.form.DynamicForm; |
13 import com.smartgwt.client.widgets.form.fields.RadioGroupItem; | 11 import com.smartgwt.client.widgets.form.fields.RadioGroupItem; |
14 import com.smartgwt.client.widgets.layout.HLayout; | 12 import com.smartgwt.client.widgets.layout.HLayout; |
15 import com.smartgwt.client.widgets.layout.VLayout; | 13 import com.smartgwt.client.widgets.layout.VLayout; |
16 | 14 |
15 import de.intevation.flys.client.client.Config; | |
16 import de.intevation.flys.client.client.FLYSConstants; | |
17 import de.intevation.flys.client.client.services.ModuleService; | 17 import de.intevation.flys.client.client.services.ModuleService; |
18 import de.intevation.flys.client.client.services.ModuleServiceAsync; | 18 import de.intevation.flys.client.client.services.ModuleServiceAsync; |
19 import de.intevation.flys.client.shared.model.Data; | 19 import de.intevation.flys.client.shared.model.Data; |
20 import de.intevation.flys.client.shared.model.DataItem; | 20 import de.intevation.flys.client.shared.model.DataItem; |
21 import de.intevation.flys.client.shared.model.DataList; | 21 import de.intevation.flys.client.shared.model.DataList; |
22 import de.intevation.flys.client.shared.model.DefaultData; | 22 import de.intevation.flys.client.shared.model.DefaultData; |
23 import de.intevation.flys.client.shared.model.DefaultDataItem; | 23 import de.intevation.flys.client.shared.model.DefaultDataItem; |
24 import de.intevation.flys.client.shared.model.Module; | 24 import de.intevation.flys.client.shared.model.Module; |
25 | 25 |
26 import de.intevation.flys.client.client.Config; | 26 import java.util.LinkedHashMap; |
27 import de.intevation.flys.client.client.FLYSConstants; | |
28 | 27 |
29 /** | 28 /** |
30 * The ModuleSelection combines the river selection and the module selection in | 29 * The ModuleSelection combines the river selection and the module selection in |
31 * one widget. It will display a vertical splitted widget - the upper part will | 30 * one widget. It will display a vertical splitted widget - the upper part will |
32 * render checkboxes for each module, the lower one will display a combobox at | 31 * render checkboxes for each module, the lower one will display a combobox at |
33 * the left and a map panel on the right to choose the river. | 32 * the left and a map panel on the right to choose the river. |
34 * | 33 * |
35 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | 34 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
36 */ | 35 */ |
37 public class ModuleSelection extends MapSelection { | 36 public class ModuleSelection extends MapSelection { |
37 | |
38 private static final long serialVersionUID = -5634831815175543328L; | |
38 | 39 |
39 /** The message class that provides i18n strings.*/ | 40 /** The message class that provides i18n strings.*/ |
40 protected FLYSConstants MESSAGES = GWT.create(FLYSConstants.class); | 41 protected FLYSConstants MESSAGES = GWT.create(FLYSConstants.class); |
41 | 42 |
42 /** The module checkboxes.*/ | 43 /** The module checkboxes.*/ |
63 * | 64 * |
64 * @param data The provided rivers. | 65 * @param data The provided rivers. |
65 * | 66 * |
66 * @return the module selection combined with the river selection. | 67 * @return the module selection combined with the river selection. |
67 */ | 68 */ |
69 @Override | |
68 public Canvas create(DataList data) { | 70 public Canvas create(DataList data) { |
69 GWT.log("ModuleSelection - create()"); | 71 GWT.log("ModuleSelection - create()"); |
70 VLayout newLayout = new VLayout(); | 72 VLayout newLayout = new VLayout(); |
71 newLayout.setMembersMargin(10); | 73 newLayout.setMembersMargin(10); |
72 newLayout.setAlign(VerticalAlignment.TOP); | 74 newLayout.setAlign(VerticalAlignment.TOP); |
98 } | 100 } |
99 }); | 101 }); |
100 } | 102 } |
101 | 103 |
102 private void setModules() { | 104 private void setModules() { |
103 LinkedHashMap values = new LinkedHashMap(); | 105 LinkedHashMap<String, String> values = new LinkedHashMap<String, String>(); |
104 | 106 |
105 if (this.modules!= null) { | 107 if (this.modules!= null) { |
106 for(Module module : this.modules) { | 108 for(Module module : this.modules) { |
107 values.put(module.getName(), module.getLocalizedName()); | 109 values.put(module.getName(), module.getLocalizedName()); |
108 if (module.isSelected()) { | 110 if (module.isSelected()) { |
156 * represents the module selection at first position, the second position | 158 * represents the module selection at first position, the second position |
157 * stores the Data object that represents the river selection. | 159 * stores the Data object that represents the river selection. |
158 * | 160 * |
159 * @return the Data that was chosen in this widget. | 161 * @return the Data that was chosen in this widget. |
160 */ | 162 */ |
163 @Override | |
161 protected Data[] getData() { | 164 protected Data[] getData() { |
162 | 165 |
163 String module = radio.getValueAsString(); | 166 String module = radio.getValueAsString(); |
164 | 167 |
165 DataItem[] items = new DefaultDataItem[1]; | 168 DataItem[] items = new DefaultDataItem[1]; |