Mercurial > dive4elements > river
annotate gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ModuleSelection.java @ 6133:3ff2a4317167
Added JavaScript callback to get the selected module in native JavaScript code.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Thu, 30 May 2013 15:08:29 +0200 |
parents | 0b9f0d37fe6e |
children | 21d92d54303e |
rev | line source |
---|---|
5861
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde |
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
2 * Software engineering by Intevation GmbH |
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
3 * |
5993
ea9eef426962
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5967
diff
changeset
|
4 * This file is Free Software under the GNU AGPL (>=v3) |
5861
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
5993
ea9eef426962
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5967
diff
changeset
|
6 * documentation coming with Dive4Elements River for details. |
5861
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
7 */ |
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
8 |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
9 package org.dive4elements.river.client.client.ui; |
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 import com.google.gwt.core.client.GWT; |
3518
33ed40aa1201
User ModuleService to get all modules for a user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2522
diff
changeset
|
12 import com.google.gwt.user.client.rpc.AsyncCallback; |
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
13 |
83
4784ca718476
Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
57
diff
changeset
|
14 import com.smartgwt.client.types.VerticalAlignment; |
3518
33ed40aa1201
User ModuleService to get all modules for a user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2522
diff
changeset
|
15 import com.smartgwt.client.util.SC; |
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
16 import com.smartgwt.client.widgets.Canvas; |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
17 import com.smartgwt.client.widgets.Label; |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
18 import com.smartgwt.client.widgets.form.DynamicForm; |
5928
34392dc16546
Implemented interaction design in project startup page.
Raimund Renkert <rrenkert@intevation.de>
parents:
5861
diff
changeset
|
19 import com.smartgwt.client.widgets.form.fields.LinkItem; |
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
20 import com.smartgwt.client.widgets.form.fields.RadioGroupItem; |
5928
34392dc16546
Implemented interaction design in project startup page.
Raimund Renkert <rrenkert@intevation.de>
parents:
5861
diff
changeset
|
21 import com.smartgwt.client.widgets.form.fields.events.ChangeEvent; |
34392dc16546
Implemented interaction design in project startup page.
Raimund Renkert <rrenkert@intevation.de>
parents:
5861
diff
changeset
|
22 import com.smartgwt.client.widgets.form.fields.events.ChangeHandler; |
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
23 import com.smartgwt.client.widgets.layout.HLayout; |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 import com.smartgwt.client.widgets.layout.VLayout; |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
25 |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
26 import org.dive4elements.river.client.client.Config; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
27 import org.dive4elements.river.client.client.FLYSConstants; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
28 import org.dive4elements.river.client.client.services.ModuleService; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
29 import org.dive4elements.river.client.client.services.ModuleServiceAsync; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
30 import org.dive4elements.river.client.shared.model.Data; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
31 import org.dive4elements.river.client.shared.model.DataItem; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
32 import org.dive4elements.river.client.shared.model.DataList; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
33 import org.dive4elements.river.client.shared.model.DefaultData; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
34 import org.dive4elements.river.client.shared.model.DefaultDataItem; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
35 import org.dive4elements.river.client.shared.model.Module; |
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
36 |
5928
34392dc16546
Implemented interaction design in project startup page.
Raimund Renkert <rrenkert@intevation.de>
parents:
5861
diff
changeset
|
37 import java.util.ArrayList; |
4131
360e22afb98b
Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents:
3530
diff
changeset
|
38 import java.util.LinkedHashMap; |
5928
34392dc16546
Implemented interaction design in project startup page.
Raimund Renkert <rrenkert@intevation.de>
parents:
5861
diff
changeset
|
39 import java.util.List; |
34392dc16546
Implemented interaction design in project startup page.
Raimund Renkert <rrenkert@intevation.de>
parents:
5861
diff
changeset
|
40 import java.util.Map; |
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
42 /** |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
43 * The ModuleSelection combines the river selection and the module selection in |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 * one widget. It will display a vertical splitted widget - the upper part will |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
45 * render checkboxes for each module, the lower one will display a combobox at |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 * the left and a map panel on the right to choose the river. |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 * |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 */ |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 public class ModuleSelection extends MapSelection { |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
51 |
4131
360e22afb98b
Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents:
3530
diff
changeset
|
52 private static final long serialVersionUID = -5634831815175543328L; |
360e22afb98b
Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents:
3530
diff
changeset
|
53 |
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
54 /** The message class that provides i18n strings.*/ |
211
b92281182c6b
Removed the FLYSMessages interface and replaced it with a FLYSConstants interface - this interface has the ability to lookup i18n strings with given keys.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
86
diff
changeset
|
55 protected FLYSConstants MESSAGES = GWT.create(FLYSConstants.class); |
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
56 |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 /** The module checkboxes.*/ |
6133
3ff2a4317167
Added JavaScript callback to get the selected module in native JavaScript code.
Raimund Renkert <rrenkert@intevation.de>
parents:
6119
diff
changeset
|
58 protected static RadioGroupItem radio; |
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 |
3518
33ed40aa1201
User ModuleService to get all modules for a user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2522
diff
changeset
|
60 /** */ |
33ed40aa1201
User ModuleService to get all modules for a user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2522
diff
changeset
|
61 protected Module[] modules; |
33ed40aa1201
User ModuleService to get all modules for a user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2522
diff
changeset
|
62 |
33ed40aa1201
User ModuleService to get all modules for a user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2522
diff
changeset
|
63 /** The ModuleService used to retrieve the available modules of a user.*/ |
33ed40aa1201
User ModuleService to get all modules for a user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2522
diff
changeset
|
64 protected ModuleServiceAsync moduleService = GWT.create(ModuleService.class); |
33ed40aa1201
User ModuleService to get all modules for a user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2522
diff
changeset
|
65 |
5928
34392dc16546
Implemented interaction design in project startup page.
Raimund Renkert <rrenkert@intevation.de>
parents:
5861
diff
changeset
|
66 private List<String> fixRivers; |
34392dc16546
Implemented interaction design in project startup page.
Raimund Renkert <rrenkert@intevation.de>
parents:
5861
diff
changeset
|
67 private List<String> minfoRivers; |
6119
0b9f0d37fe6e
We have a much faster interactive image map!
Raimund Renkert <rrenkert@intevation.de>
parents:
5993
diff
changeset
|
68 protected Map<String, HLayout> rivers; |
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
69 |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
70 /** |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 * The default constructor. |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
72 */ |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
73 public ModuleSelection() { |
5928
34392dc16546
Implemented interaction design in project startup page.
Raimund Renkert <rrenkert@intevation.de>
parents:
5861
diff
changeset
|
74 rivers = null; |
34392dc16546
Implemented interaction design in project startup page.
Raimund Renkert <rrenkert@intevation.de>
parents:
5861
diff
changeset
|
75 //TODO: put all the rivers into a config file, or something. |
34392dc16546
Implemented interaction design in project startup page.
Raimund Renkert <rrenkert@intevation.de>
parents:
5861
diff
changeset
|
76 fixRivers = new ArrayList<String>(); |
34392dc16546
Implemented interaction design in project startup page.
Raimund Renkert <rrenkert@intevation.de>
parents:
5861
diff
changeset
|
77 fixRivers.add("Rhein"); |
34392dc16546
Implemented interaction design in project startup page.
Raimund Renkert <rrenkert@intevation.de>
parents:
5861
diff
changeset
|
78 fixRivers.add("Elbe"); |
34392dc16546
Implemented interaction design in project startup page.
Raimund Renkert <rrenkert@intevation.de>
parents:
5861
diff
changeset
|
79 fixRivers.add("Donau"); |
5967
59afa245549b
Added available rivers for fix analysis for interactive image map.
Raimund Renkert <rrenkert@intevation.de>
parents:
5928
diff
changeset
|
80 fixRivers.add("Fulda (Sommer)"); |
59afa245549b
Added available rivers for fix analysis for interactive image map.
Raimund Renkert <rrenkert@intevation.de>
parents:
5928
diff
changeset
|
81 fixRivers.add("Havel"); |
59afa245549b
Added available rivers for fix analysis for interactive image map.
Raimund Renkert <rrenkert@intevation.de>
parents:
5928
diff
changeset
|
82 fixRivers.add("Lahn"); |
59afa245549b
Added available rivers for fix analysis for interactive image map.
Raimund Renkert <rrenkert@intevation.de>
parents:
5928
diff
changeset
|
83 fixRivers.add("Main"); |
59afa245549b
Added available rivers for fix analysis for interactive image map.
Raimund Renkert <rrenkert@intevation.de>
parents:
5928
diff
changeset
|
84 fixRivers.add("Mosel"); |
59afa245549b
Added available rivers for fix analysis for interactive image map.
Raimund Renkert <rrenkert@intevation.de>
parents:
5928
diff
changeset
|
85 fixRivers.add("Neckar"); |
59afa245549b
Added available rivers for fix analysis for interactive image map.
Raimund Renkert <rrenkert@intevation.de>
parents:
5928
diff
changeset
|
86 fixRivers.add("Oder"); |
59afa245549b
Added available rivers for fix analysis for interactive image map.
Raimund Renkert <rrenkert@intevation.de>
parents:
5928
diff
changeset
|
87 fixRivers.add("Saale"); |
59afa245549b
Added available rivers for fix analysis for interactive image map.
Raimund Renkert <rrenkert@intevation.de>
parents:
5928
diff
changeset
|
88 fixRivers.add("Saar"); |
59afa245549b
Added available rivers for fix analysis for interactive image map.
Raimund Renkert <rrenkert@intevation.de>
parents:
5928
diff
changeset
|
89 fixRivers.add("Saar (Wiltinger Bogen)"); |
59afa245549b
Added available rivers for fix analysis for interactive image map.
Raimund Renkert <rrenkert@intevation.de>
parents:
5928
diff
changeset
|
90 fixRivers.add("Werra (Sommer)"); |
59afa245549b
Added available rivers for fix analysis for interactive image map.
Raimund Renkert <rrenkert@intevation.de>
parents:
5928
diff
changeset
|
91 fixRivers.add("Weser"); |
5928
34392dc16546
Implemented interaction design in project startup page.
Raimund Renkert <rrenkert@intevation.de>
parents:
5861
diff
changeset
|
92 |
34392dc16546
Implemented interaction design in project startup page.
Raimund Renkert <rrenkert@intevation.de>
parents:
5861
diff
changeset
|
93 minfoRivers = new ArrayList<String>(); |
34392dc16546
Implemented interaction design in project startup page.
Raimund Renkert <rrenkert@intevation.de>
parents:
5861
diff
changeset
|
94 minfoRivers.add("Elbe"); |
34392dc16546
Implemented interaction design in project startup page.
Raimund Renkert <rrenkert@intevation.de>
parents:
5861
diff
changeset
|
95 minfoRivers.add("Rhein"); |
34392dc16546
Implemented interaction design in project startup page.
Raimund Renkert <rrenkert@intevation.de>
parents:
5861
diff
changeset
|
96 minfoRivers.add("Oder"); |
34392dc16546
Implemented interaction design in project startup page.
Raimund Renkert <rrenkert@intevation.de>
parents:
5861
diff
changeset
|
97 |
3518
33ed40aa1201
User ModuleService to get all modules for a user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2522
diff
changeset
|
98 readModules(); |
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
99 } |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
100 |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
101 |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
102 /** |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
103 * This method returns a widget that renders the checkboxes for each module |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
104 * and the MapSelection that lets the user choose the river. |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
105 * |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
106 * @param data The provided rivers. |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
107 * |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
108 * @return the module selection combined with the river selection. |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
109 */ |
4131
360e22afb98b
Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents:
3530
diff
changeset
|
110 @Override |
51
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
111 public Canvas create(DataList data) { |
3518
33ed40aa1201
User ModuleService to get all modules for a user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2522
diff
changeset
|
112 GWT.log("ModuleSelection - create()"); |
6133
3ff2a4317167
Added JavaScript callback to get the selected module in native JavaScript code.
Raimund Renkert <rrenkert@intevation.de>
parents:
6119
diff
changeset
|
113 createCallback(); |
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
114 VLayout newLayout = new VLayout(); |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
115 newLayout.setMembersMargin(10); |
282
e92f7ef455d6
Show rivers as links instead of a combobox.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
116 newLayout.setAlign(VerticalAlignment.TOP); |
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
117 Canvas moduleSelection = createWidget(); |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
118 |
282
e92f7ef455d6
Show rivers as links instead of a combobox.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
119 moduleSelection.setHeight(100); |
e92f7ef455d6
Show rivers as links instead of a combobox.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
120 newLayout.setHeight(70); |
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
121 newLayout.addMember(moduleSelection); |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
122 |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
123 return newLayout; |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
124 } |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
125 |
3518
33ed40aa1201
User ModuleService to get all modules for a user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2522
diff
changeset
|
126 private void readModules() { |
33ed40aa1201
User ModuleService to get all modules for a user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2522
diff
changeset
|
127 Config config = Config.getInstance(); |
33ed40aa1201
User ModuleService to get all modules for a user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2522
diff
changeset
|
128 String locale = config.getLocale(); |
33ed40aa1201
User ModuleService to get all modules for a user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2522
diff
changeset
|
129 |
33ed40aa1201
User ModuleService to get all modules for a user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2522
diff
changeset
|
130 moduleService.list(locale, new AsyncCallback<Module[]>() { |
33ed40aa1201
User ModuleService to get all modules for a user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2522
diff
changeset
|
131 @Override |
33ed40aa1201
User ModuleService to get all modules for a user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2522
diff
changeset
|
132 public void onFailure(Throwable caught) { |
33ed40aa1201
User ModuleService to get all modules for a user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2522
diff
changeset
|
133 GWT.log("Could not recieve a list of modules."); |
33ed40aa1201
User ModuleService to get all modules for a user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2522
diff
changeset
|
134 SC.warn(MSG.getString(caught.getMessage())); |
33ed40aa1201
User ModuleService to get all modules for a user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2522
diff
changeset
|
135 } |
33ed40aa1201
User ModuleService to get all modules for a user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2522
diff
changeset
|
136 |
33ed40aa1201
User ModuleService to get all modules for a user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2522
diff
changeset
|
137 @Override |
33ed40aa1201
User ModuleService to get all modules for a user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2522
diff
changeset
|
138 public void onSuccess(Module[] newmodules) { |
33ed40aa1201
User ModuleService to get all modules for a user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2522
diff
changeset
|
139 GWT.log("Retrieved " + newmodules.length + " modules."); |
33ed40aa1201
User ModuleService to get all modules for a user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2522
diff
changeset
|
140 modules = newmodules; |
33ed40aa1201
User ModuleService to get all modules for a user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2522
diff
changeset
|
141 setModules(); |
33ed40aa1201
User ModuleService to get all modules for a user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2522
diff
changeset
|
142 } |
33ed40aa1201
User ModuleService to get all modules for a user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2522
diff
changeset
|
143 }); |
33ed40aa1201
User ModuleService to get all modules for a user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2522
diff
changeset
|
144 } |
33ed40aa1201
User ModuleService to get all modules for a user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2522
diff
changeset
|
145 |
33ed40aa1201
User ModuleService to get all modules for a user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2522
diff
changeset
|
146 private void setModules() { |
4131
360e22afb98b
Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents:
3530
diff
changeset
|
147 LinkedHashMap<String, String> values = new LinkedHashMap<String, String>(); |
3530
8c9c202292fe
Set the default value of the RadioGroupItem if a loaded module is selected
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3518
diff
changeset
|
148 |
3518
33ed40aa1201
User ModuleService to get all modules for a user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2522
diff
changeset
|
149 if (this.modules!= null) { |
33ed40aa1201
User ModuleService to get all modules for a user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2522
diff
changeset
|
150 for(Module module : this.modules) { |
33ed40aa1201
User ModuleService to get all modules for a user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2522
diff
changeset
|
151 values.put(module.getName(), module.getLocalizedName()); |
3530
8c9c202292fe
Set the default value of the RadioGroupItem if a loaded module is selected
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3518
diff
changeset
|
152 if (module.isSelected()) { |
8c9c202292fe
Set the default value of the RadioGroupItem if a loaded module is selected
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3518
diff
changeset
|
153 GWT.log("Module " + module.getName() + " is selected."); |
8c9c202292fe
Set the default value of the RadioGroupItem if a loaded module is selected
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3518
diff
changeset
|
154 if (radio != null) { |
8c9c202292fe
Set the default value of the RadioGroupItem if a loaded module is selected
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3518
diff
changeset
|
155 radio.setDefaultValue(module.getName()); |
8c9c202292fe
Set the default value of the RadioGroupItem if a loaded module is selected
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3518
diff
changeset
|
156 GWT.log("Setting " + module.getName() + " as selected."); |
8c9c202292fe
Set the default value of the RadioGroupItem if a loaded module is selected
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3518
diff
changeset
|
157 } |
8c9c202292fe
Set the default value of the RadioGroupItem if a loaded module is selected
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3518
diff
changeset
|
158 } |
3518
33ed40aa1201
User ModuleService to get all modules for a user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2522
diff
changeset
|
159 } |
33ed40aa1201
User ModuleService to get all modules for a user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2522
diff
changeset
|
160 } |
33ed40aa1201
User ModuleService to get all modules for a user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2522
diff
changeset
|
161 if (radio != null) { |
33ed40aa1201
User ModuleService to get all modules for a user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2522
diff
changeset
|
162 radio.setValueMap(values); |
33ed40aa1201
User ModuleService to get all modules for a user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2522
diff
changeset
|
163 } |
33ed40aa1201
User ModuleService to get all modules for a user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2522
diff
changeset
|
164 } |
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
165 |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
166 /** |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
167 * Creates a widget that displays a checkbox for each module. |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
168 * |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
169 * @return a widget with checkboxes. |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
170 */ |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
171 protected Canvas createWidget() { |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
172 HLayout layout = new HLayout(); |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
173 |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
174 Label label = new Label(MESSAGES.module_selection()); |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
175 DynamicForm form = new DynamicForm(); |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
176 |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
177 radio = new RadioGroupItem("plugin"); |
5928
34392dc16546
Implemented interaction design in project startup page.
Raimund Renkert <rrenkert@intevation.de>
parents:
5861
diff
changeset
|
178 radio.addChangeHandler(new ChangeHandler() { |
34392dc16546
Implemented interaction design in project startup page.
Raimund Renkert <rrenkert@intevation.de>
parents:
5861
diff
changeset
|
179 @Override |
34392dc16546
Implemented interaction design in project startup page.
Raimund Renkert <rrenkert@intevation.de>
parents:
5861
diff
changeset
|
180 public void onChange(ChangeEvent event) { |
34392dc16546
Implemented interaction design in project startup page.
Raimund Renkert <rrenkert@intevation.de>
parents:
5861
diff
changeset
|
181 String selected = (String)event.getValue(); |
34392dc16546
Implemented interaction design in project startup page.
Raimund Renkert <rrenkert@intevation.de>
parents:
5861
diff
changeset
|
182 if (!rivers.isEmpty()) { |
6119
0b9f0d37fe6e
We have a much faster interactive image map!
Raimund Renkert <rrenkert@intevation.de>
parents:
5993
diff
changeset
|
183 for (Map.Entry<String, HLayout> s: rivers.entrySet()) { |
5928
34392dc16546
Implemented interaction design in project startup page.
Raimund Renkert <rrenkert@intevation.de>
parents:
5861
diff
changeset
|
184 if (selected.equals("minfo") && !minfoRivers.contains(s.getKey())) { |
34392dc16546
Implemented interaction design in project startup page.
Raimund Renkert <rrenkert@intevation.de>
parents:
5861
diff
changeset
|
185 s.getValue().hide(); |
34392dc16546
Implemented interaction design in project startup page.
Raimund Renkert <rrenkert@intevation.de>
parents:
5861
diff
changeset
|
186 } |
34392dc16546
Implemented interaction design in project startup page.
Raimund Renkert <rrenkert@intevation.de>
parents:
5861
diff
changeset
|
187 else if (selected.equals("fixanalysis") && !fixRivers.contains(s.getKey())) { |
34392dc16546
Implemented interaction design in project startup page.
Raimund Renkert <rrenkert@intevation.de>
parents:
5861
diff
changeset
|
188 s.getValue().hide(); |
34392dc16546
Implemented interaction design in project startup page.
Raimund Renkert <rrenkert@intevation.de>
parents:
5861
diff
changeset
|
189 } |
34392dc16546
Implemented interaction design in project startup page.
Raimund Renkert <rrenkert@intevation.de>
parents:
5861
diff
changeset
|
190 else { |
34392dc16546
Implemented interaction design in project startup page.
Raimund Renkert <rrenkert@intevation.de>
parents:
5861
diff
changeset
|
191 s.getValue().show(); |
34392dc16546
Implemented interaction design in project startup page.
Raimund Renkert <rrenkert@intevation.de>
parents:
5861
diff
changeset
|
192 } |
34392dc16546
Implemented interaction design in project startup page.
Raimund Renkert <rrenkert@intevation.de>
parents:
5861
diff
changeset
|
193 } |
34392dc16546
Implemented interaction design in project startup page.
Raimund Renkert <rrenkert@intevation.de>
parents:
5861
diff
changeset
|
194 } |
34392dc16546
Implemented interaction design in project startup page.
Raimund Renkert <rrenkert@intevation.de>
parents:
5861
diff
changeset
|
195 } |
34392dc16546
Implemented interaction design in project startup page.
Raimund Renkert <rrenkert@intevation.de>
parents:
5861
diff
changeset
|
196 }); |
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
197 |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
198 label.setWidth(50); |
282
e92f7ef455d6
Show rivers as links instead of a combobox.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
199 label.setHeight(25); |
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
200 |
45
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
38
diff
changeset
|
201 |
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
202 radio.setShowTitle(false); |
86
eae92a05282e
Added a further plugin in the module selection and changed its alignment to vertical.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
83
diff
changeset
|
203 radio.setVertical(true); |
45
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
38
diff
changeset
|
204 |
3518
33ed40aa1201
User ModuleService to get all modules for a user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2522
diff
changeset
|
205 setModules(); |
33ed40aa1201
User ModuleService to get all modules for a user
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
2522
diff
changeset
|
206 |
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
207 form.setFields(radio); |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
208 |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
209 layout.addMember(label); |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
210 layout.addMember(form); |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
211 |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
212 return layout; |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
213 } |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
214 |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
215 |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
216 /** |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
217 * This method prepares the data of two widgets - the module selection and |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
218 * the river selection. The returning field will contain the Data that |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
219 * represents the module selection at first position, the second position |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
220 * stores the Data object that represents the river selection. |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
221 * |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
222 * @return the Data that was chosen in this widget. |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
223 */ |
4131
360e22afb98b
Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents:
3530
diff
changeset
|
224 @Override |
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
225 protected Data[] getData() { |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
226 |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
227 String module = radio.getValueAsString(); |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
228 |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
229 DataItem[] items = new DefaultDataItem[1]; |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
230 items[0] = new DefaultDataItem(module, module, module); |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
231 |
51
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
45
diff
changeset
|
232 Data data = new DefaultData("module", null, null, items); |
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
233 |
282
e92f7ef455d6
Show rivers as links instead of a combobox.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
234 return new Data[] {data}; |
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
235 } |
5928
34392dc16546
Implemented interaction design in project startup page.
Raimund Renkert <rrenkert@intevation.de>
parents:
5861
diff
changeset
|
236 |
6119
0b9f0d37fe6e
We have a much faster interactive image map!
Raimund Renkert <rrenkert@intevation.de>
parents:
5993
diff
changeset
|
237 public void setRivers(Map<String, HLayout> rivers) { |
5928
34392dc16546
Implemented interaction design in project startup page.
Raimund Renkert <rrenkert@intevation.de>
parents:
5861
diff
changeset
|
238 this.rivers = rivers; |
34392dc16546
Implemented interaction design in project startup page.
Raimund Renkert <rrenkert@intevation.de>
parents:
5861
diff
changeset
|
239 } |
6133
3ff2a4317167
Added JavaScript callback to get the selected module in native JavaScript code.
Raimund Renkert <rrenkert@intevation.de>
parents:
6119
diff
changeset
|
240 |
3ff2a4317167
Added JavaScript callback to get the selected module in native JavaScript code.
Raimund Renkert <rrenkert@intevation.de>
parents:
6119
diff
changeset
|
241 private native void createCallback() /*-{ |
3ff2a4317167
Added JavaScript callback to get the selected module in native JavaScript code.
Raimund Renkert <rrenkert@intevation.de>
parents:
6119
diff
changeset
|
242 $wnd.getModule = @org.dive4elements.river.client.client.ui.ModuleSelection::getSelectedModule(); |
3ff2a4317167
Added JavaScript callback to get the selected module in native JavaScript code.
Raimund Renkert <rrenkert@intevation.de>
parents:
6119
diff
changeset
|
243 }-*/; |
3ff2a4317167
Added JavaScript callback to get the selected module in native JavaScript code.
Raimund Renkert <rrenkert@intevation.de>
parents:
6119
diff
changeset
|
244 |
3ff2a4317167
Added JavaScript callback to get the selected module in native JavaScript code.
Raimund Renkert <rrenkert@intevation.de>
parents:
6119
diff
changeset
|
245 private static String getSelectedModule() { |
3ff2a4317167
Added JavaScript callback to get the selected module in native JavaScript code.
Raimund Renkert <rrenkert@intevation.de>
parents:
6119
diff
changeset
|
246 GWT.log("selected: " + radio.getValueAsString()); |
3ff2a4317167
Added JavaScript callback to get the selected module in native JavaScript code.
Raimund Renkert <rrenkert@intevation.de>
parents:
6119
diff
changeset
|
247 return radio.getValueAsString(); |
3ff2a4317167
Added JavaScript callback to get the selected module in native JavaScript code.
Raimund Renkert <rrenkert@intevation.de>
parents:
6119
diff
changeset
|
248 } |
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
249 } |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
250 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |