Mercurial > dive4elements > river
annotate flys-client/src/main/java/de/intevation/flys/client/client/ui/SelectProvider.java @ 5539:8d0af912351c
Revert config.yaml to usable version.
Some changes to Map resizing in DigitizePanel.
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Wed, 03 Apr 2013 15:59:01 +0200 |
parents | 32a4651eef93 |
children |
rev | line source |
---|---|
20
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.client.client.ui; |
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
3 import com.google.gwt.core.client.GWT; |
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:
20
diff
changeset
|
4 import com.smartgwt.client.types.VerticalAlignment; |
20
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
5 import com.smartgwt.client.widgets.Canvas; |
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:
20
diff
changeset
|
6 import com.smartgwt.client.widgets.Label; |
20
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
7 import com.smartgwt.client.widgets.form.DynamicForm; |
4573
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
8 import com.smartgwt.client.widgets.form.fields.FormItem; |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
9 import com.smartgwt.client.widgets.form.fields.LinkItem; |
592
f8f8982e2d5c
The comboboxes to select the calculation mode are no longer editable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
519
diff
changeset
|
10 import com.smartgwt.client.widgets.form.fields.SelectItem; |
4573
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
11 import com.smartgwt.client.widgets.form.fields.SpacerItem; |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
12 import com.smartgwt.client.widgets.form.fields.events.ClickEvent; |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
13 import com.smartgwt.client.widgets.form.fields.events.ClickHandler; |
53
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
14 import com.smartgwt.client.widgets.layout.HLayout; |
20
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
15 import com.smartgwt.client.widgets.layout.VLayout; |
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
16 |
4184
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
2537
diff
changeset
|
17 import de.intevation.flys.client.client.FLYSConstants; |
4573
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
18 import de.intevation.flys.client.client.event.StepForwardEvent; |
20
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
19 import de.intevation.flys.client.shared.model.Data; |
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
20 import de.intevation.flys.client.shared.model.DataItem; |
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:
49
diff
changeset
|
21 import de.intevation.flys.client.shared.model.DataList; |
20
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
22 import de.intevation.flys.client.shared.model.DefaultData; |
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
23 import de.intevation.flys.client.shared.model.DefaultDataItem; |
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 |
4573
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
25 import java.util.ArrayList; |
4184
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
2537
diff
changeset
|
26 import java.util.Iterator; |
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
2537
diff
changeset
|
27 import java.util.LinkedHashMap; |
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
2537
diff
changeset
|
28 import java.util.Map; |
20
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 |
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 |
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 /** |
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 * This UIProvider displays the DataItems of the Data object in a combo box. |
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
33 * |
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
34 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 */ |
49
d573ae975330
Some refactoring (imports, etc).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
38
diff
changeset
|
36 public class SelectProvider |
d573ae975330
Some refactoring (imports, etc).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
38
diff
changeset
|
37 extends AbstractUIProvider |
20
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
38 { |
4184
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
2537
diff
changeset
|
39 private static final long serialVersionUID = 4696637534424070726L; |
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
2537
diff
changeset
|
40 |
20
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 /** 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:
101
diff
changeset
|
42 protected FLYSConstants messages = GWT.create(FLYSConstants.class); |
20
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
43 |
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 /** The combobox.*/ |
4573
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
45 protected DynamicForm form = new DynamicForm(); |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
46 |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
47 public static final int COMBOBOX_THRESHOLD = 20; |
38
7142386e86c2
Some improvements for displaying old parameters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
37
diff
changeset
|
48 |
20
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 |
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 /** |
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
51 * This method currently returns a |
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
52 * {@link com.smartgwt.client.widgets.form.DynamicForm} that contains all |
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
53 * data items in a combobox stored in <i>data</i>. |
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
54 * |
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
55 * @param data The {@link Data} object. |
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
56 * |
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 * @return a combobox. |
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 */ |
4184
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
2537
diff
changeset
|
59 @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:
49
diff
changeset
|
60 public Canvas create(DataList data) { |
4574
32a4651eef93
flys-client: Shapefile upload widget readded again (regression).
Christian Lins <christian.lins@intevation.de>
parents:
4573
diff
changeset
|
61 VLayout v = new VLayout(); |
32a4651eef93
flys-client: Shapefile upload widget readded again (regression).
Christian Lins <christian.lins@intevation.de>
parents:
4573
diff
changeset
|
62 v.setMembersMargin(10); |
32a4651eef93
flys-client: Shapefile upload widget readded again (regression).
Christian Lins <christian.lins@intevation.de>
parents:
4573
diff
changeset
|
63 v.addMember(createWidget(data)); |
32a4651eef93
flys-client: Shapefile upload widget readded again (regression).
Christian Lins <christian.lins@intevation.de>
parents:
4573
diff
changeset
|
64 if(data.size() > COMBOBOX_THRESHOLD) { |
32a4651eef93
flys-client: Shapefile upload widget readded again (regression).
Christian Lins <christian.lins@intevation.de>
parents:
4573
diff
changeset
|
65 v.addMember(getNextButton()); |
32a4651eef93
flys-client: Shapefile upload widget readded again (regression).
Christian Lins <christian.lins@intevation.de>
parents:
4573
diff
changeset
|
66 } |
32a4651eef93
flys-client: Shapefile upload widget readded again (regression).
Christian Lins <christian.lins@intevation.de>
parents:
4573
diff
changeset
|
67 return v; |
32a4651eef93
flys-client: Shapefile upload widget readded again (regression).
Christian Lins <christian.lins@intevation.de>
parents:
4573
diff
changeset
|
68 } |
32a4651eef93
flys-client: Shapefile upload widget readded again (regression).
Christian Lins <christian.lins@intevation.de>
parents:
4573
diff
changeset
|
69 |
32a4651eef93
flys-client: Shapefile upload widget readded again (regression).
Christian Lins <christian.lins@intevation.de>
parents:
4573
diff
changeset
|
70 |
32a4651eef93
flys-client: Shapefile upload widget readded again (regression).
Christian Lins <christian.lins@intevation.de>
parents:
4573
diff
changeset
|
71 protected Canvas createWidget(DataList data) { |
4573
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
72 if (data.size() > COMBOBOX_THRESHOLD) { |
4574
32a4651eef93
flys-client: Shapefile upload widget readded again (regression).
Christian Lins <christian.lins@intevation.de>
parents:
4573
diff
changeset
|
73 return createComboboxWidget(data); |
4573
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
74 } |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
75 else { |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
76 return createListWidget(data); |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
77 } |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
78 } |
20
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
79 |
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
80 |
4184
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
2537
diff
changeset
|
81 @Override |
53
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
82 public Canvas createOld(DataList dataList) { |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
83 HLayout layout = new HLayout(); |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
84 VLayout vLayout = new VLayout(); |
91
0d8203594bb4
Resized CollectionView and set the content size to have a tabled style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
83
diff
changeset
|
85 layout.setWidth("400px"); |
53
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
86 |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
87 Label label = new Label(dataList.getLabel()); |
91
0d8203594bb4
Resized CollectionView and set the content size to have a tabled style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
83
diff
changeset
|
88 label.setWidth("200px"); |
53
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
89 |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
90 int size = dataList.size(); |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
91 for (int i = 0; i < size; i++) { |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
92 Data data = dataList.get(i); |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
93 DataItem[] items = data.getItems(); |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
94 |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
95 for (DataItem item: items) { |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
96 HLayout hLayout = new HLayout(); |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
97 |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
98 hLayout.addMember(label); |
61
f983d5ce6402
Display human readable strings of the selected values in the UI.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
99 hLayout.addMember(new Label(item.getLabel())); |
53
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
100 |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
101 vLayout.addMember(hLayout); |
91
0d8203594bb4
Resized CollectionView and set the content size to have a tabled style.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
83
diff
changeset
|
102 vLayout.setWidth("130px"); |
53
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
103 } |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
104 } |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
105 |
58
d018995fbee7
The 'old' items in the parameter panel have a button to step back to a previous state (NOTE: just the UI stuff is implemented now).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
57
diff
changeset
|
106 Canvas back = getBackButton(dataList.getState()); |
d018995fbee7
The 'old' items in the parameter panel have a button to step back to a previous state (NOTE: just the UI stuff is implemented now).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
57
diff
changeset
|
107 |
53
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
108 layout.addMember(label); |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
109 layout.addMember(vLayout); |
58
d018995fbee7
The 'old' items in the parameter panel have a button to step back to a previous state (NOTE: just the UI stuff is implemented now).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
57
diff
changeset
|
110 layout.addMember(back); |
53
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
111 |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
112 return layout; |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
113 } |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
114 |
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
115 |
4573
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
116 protected Canvas createListWidget(DataList data) { |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
117 VLayout layout = new VLayout(); |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
118 layout.setAlign(VerticalAlignment.TOP); |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
119 layout.setHeight(25); |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
120 layout.setWidth("100%"); |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
121 |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
122 VLayout formLayout = new VLayout(); |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
123 formLayout.setLayoutTopMargin(20); |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
124 formLayout.setLayoutLeftMargin(50); |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
125 |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
126 ClickHandler handler = new ClickHandler() { |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
127 @Override |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
128 public void onClick(ClickEvent event) { |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
129 LinkItem li = (LinkItem)event.getItem(); |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
130 String attr = li.getAttribute(li.getName()); |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
131 GWT.log("li.getTarget: " + attr + " " + li.getName()); |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
132 DataItem item = new DefaultDataItem( |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
133 attr, |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
134 null, |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
135 attr); |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
136 |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
137 Data d = new DefaultData( |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
138 li.getName(), |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
139 null, |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
140 null, |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
141 new DataItem [] { item }); |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
142 |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
143 Data [] odata = getData(); |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
144 Data [] ndata = new Data[odata.length+1]; |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
145 System.arraycopy(odata, 0, ndata, 0, odata.length); |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
146 ndata[odata.length] = d; |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
147 |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
148 fireStepForwardEvent(new StepForwardEvent(ndata)); |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
149 } |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
150 }; |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
151 |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
152 for (int i = 0, size = data.size(); i < size; i++) { |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
153 Data d = data.get(i); |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
154 |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
155 Label label = new Label(d.getDescription()); |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
156 label.setValign(VerticalAlignment.TOP); |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
157 label.setHeight(20); |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
158 label.setWidth(400); |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
159 |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
160 LinkedHashMap<String, String> initial = new LinkedHashMap<String, String>(); |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
161 ArrayList<FormItem> formItems = new ArrayList<FormItem>(); |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
162 |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
163 for (DataItem item: d.getItems()) { |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
164 initial.put(item.getLabel().replace(' ', '_'), item.getStringValue()); |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
165 GWT.log("put: " + item.getLabel().replace(' ', '_') + "=" + item.getStringValue()); |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
166 |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
167 LinkItem link = new LinkItem(d.getLabel()); |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
168 link.setLinkTitle(item.getLabel()); // i18n text of the link |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
169 link.setAttribute(d.getLabel(), item.getStringValue()); // e.g. "calculation_mode":"foo" |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
170 link.setShowTitle(false); |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
171 link.setEndRow(true); |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
172 link.setWidth("350px"); |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
173 |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
174 SpacerItem space = new SpacerItem(); |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
175 space.setWidth(15); |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
176 formItems.add(space); |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
177 formItems.add(link); |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
178 |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
179 link.addClickHandler(handler); |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
180 } |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
181 |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
182 form.setFields(formItems.toArray(new FormItem[0])); |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
183 form.setValues(initial); |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
184 |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
185 layout.addMember(label); |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
186 layout.addMember(form); |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
187 } |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
188 return layout; |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
189 } |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
190 |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
191 protected Canvas createComboboxWidget(DataList data) { |
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
192 GWT.log("SelectProvider.createComboboxWidget()"); |
20
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
193 |
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:
49
diff
changeset
|
194 VLayout layout = new VLayout(); |
83
4784ca718476
Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
195 layout.setAlign(VerticalAlignment.TOP); |
4784ca718476
Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
61
diff
changeset
|
196 layout.setHeight(25); |
20
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
197 |
4184
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
2537
diff
changeset
|
198 LinkedHashMap<String, String> initial = new LinkedHashMap<String, String>(); |
266
e3565f58b0ae
ISSUE-38 Set the first value of a select box as default value.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
199 |
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:
49
diff
changeset
|
200 int size = data.size(); |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
49
diff
changeset
|
201 |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
49
diff
changeset
|
202 for (int i = 0; i < size; i++) { |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
49
diff
changeset
|
203 Data d = data.get(i); |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
49
diff
changeset
|
204 |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
49
diff
changeset
|
205 Label label = new Label(d.getDescription()); |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
49
diff
changeset
|
206 label.setValign(VerticalAlignment.TOP); |
53
3d5d7788d471
The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
207 label.setHeight(20); |
785
3ae0facd4cab
Added a panel that lets users step to a next state without feeding the current artifact with new data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
594
diff
changeset
|
208 label.setWidth(400); |
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:
49
diff
changeset
|
209 |
594
646cf09dabf2
Initialize the combobox in the SelectProvider correctly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
592
diff
changeset
|
210 SelectItem combobox = new SelectItem(d.getLabel()); |
592
f8f8982e2d5c
The comboboxes to select the calculation mode are no longer editable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
519
diff
changeset
|
211 combobox.setWidth(250); |
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:
49
diff
changeset
|
212 |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
49
diff
changeset
|
213 LinkedHashMap<String, String> it = new LinkedHashMap<String, String>(); |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
49
diff
changeset
|
214 |
519
77234b1d009c
ISSUE-90 & ISSUE-40 (part II/II) Former selected values are preselected after back jumps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
266
diff
changeset
|
215 boolean defaultSet = false; |
77234b1d009c
ISSUE-90 & ISSUE-40 (part II/II) Former selected values are preselected after back jumps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
266
diff
changeset
|
216 boolean first = true; |
77234b1d009c
ISSUE-90 & ISSUE-40 (part II/II) Former selected values are preselected after back jumps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
266
diff
changeset
|
217 |
77234b1d009c
ISSUE-90 & ISSUE-40 (part II/II) Former selected values are preselected after back jumps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
266
diff
changeset
|
218 DataItem def = d.getDefault(); |
77234b1d009c
ISSUE-90 & ISSUE-40 (part II/II) Former selected values are preselected after back jumps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
266
diff
changeset
|
219 String defValue = def != null ? def.getStringValue() : null; |
77234b1d009c
ISSUE-90 & ISSUE-40 (part II/II) Former selected values are preselected after back jumps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
266
diff
changeset
|
220 |
77234b1d009c
ISSUE-90 & ISSUE-40 (part II/II) Former selected values are preselected after back jumps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
266
diff
changeset
|
221 if (defValue != null && defValue.length() > 0) { |
77234b1d009c
ISSUE-90 & ISSUE-40 (part II/II) Former selected values are preselected after back jumps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
266
diff
changeset
|
222 initial.put(d.getLabel(), def.getStringValue()); |
77234b1d009c
ISSUE-90 & ISSUE-40 (part II/II) Former selected values are preselected after back jumps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
266
diff
changeset
|
223 defaultSet = true; |
77234b1d009c
ISSUE-90 & ISSUE-40 (part II/II) Former selected values are preselected after back jumps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
266
diff
changeset
|
224 } |
266
e3565f58b0ae
ISSUE-38 Set the first value of a select box as default value.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
225 |
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:
49
diff
changeset
|
226 for (DataItem item: d.getItems()) { |
519
77234b1d009c
ISSUE-90 & ISSUE-40 (part II/II) Former selected values are preselected after back jumps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
266
diff
changeset
|
227 if (!defaultSet && first) { |
266
e3565f58b0ae
ISSUE-38 Set the first value of a select box as default value.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
228 initial.put(d.getLabel(), item.getStringValue()); |
519
77234b1d009c
ISSUE-90 & ISSUE-40 (part II/II) Former selected values are preselected after back jumps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
266
diff
changeset
|
229 first = false; |
266
e3565f58b0ae
ISSUE-38 Set the first value of a select box as default value.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
230 } |
e3565f58b0ae
ISSUE-38 Set the first value of a select box as default value.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
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:
49
diff
changeset
|
232 it.put(item.getStringValue(), item.getLabel()); |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
49
diff
changeset
|
233 } |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
49
diff
changeset
|
234 |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
49
diff
changeset
|
235 label.setWidth(50); |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
49
diff
changeset
|
236 combobox.setValueMap(it); |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
49
diff
changeset
|
237 combobox.setShowTitle(false); |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
49
diff
changeset
|
238 form.setItems(combobox); |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
49
diff
changeset
|
239 |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
49
diff
changeset
|
240 layout.addMember(label); |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
49
diff
changeset
|
241 layout.addMember(form); |
20
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
242 } |
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
243 |
266
e3565f58b0ae
ISSUE-38 Set the first value of a select box as default value.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
244 form.setValues(initial); |
e3565f58b0ae
ISSUE-38 Set the first value of a select box as default value.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
245 |
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:
20
diff
changeset
|
246 layout.setAlign(VerticalAlignment.TOP); |
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:
20
diff
changeset
|
247 |
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:
20
diff
changeset
|
248 return layout; |
20
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
249 } |
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
250 |
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
251 |
4184
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
2537
diff
changeset
|
252 @Override |
20
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
253 protected Data[] getData() { |
4184
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
2537
diff
changeset
|
254 Map<?,?> values = form.getValues(); |
03de5c424f95
Fix warnings and minor TODOs in flys-client.
Christian Lins <christian.lins@intevation.de>
parents:
2537
diff
changeset
|
255 Iterator<?> keys = values.keySet().iterator(); |
20
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
256 |
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:
49
diff
changeset
|
257 Data[] list = new Data[values.size()]; |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
49
diff
changeset
|
258 int i = 0; |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
49
diff
changeset
|
259 |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
49
diff
changeset
|
260 while (keys.hasNext()) { |
4573
b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
Christian Lins <christian.lins@intevation.de>
parents:
4184
diff
changeset
|
261 String fieldname = ((String) keys.next()).replace('_', ' '); |
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:
49
diff
changeset
|
262 String selection = (String) values.get(fieldname); |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
49
diff
changeset
|
263 |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
49
diff
changeset
|
264 DataItem item = new DefaultDataItem(fieldname, null, selection); |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
49
diff
changeset
|
265 |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
49
diff
changeset
|
266 list[i++] = new DefaultData( |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
49
diff
changeset
|
267 fieldname, null, null, new DataItem[] { item }); |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
49
diff
changeset
|
268 } |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
49
diff
changeset
|
269 |
a2923d63f530
Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
49
diff
changeset
|
270 return list; |
20
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
271 } |
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
272 } |
c128d675386b
Added UIProviders that are used to create widgets for entering data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
273 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |