Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/LinkSelection.java @ 4064:61020a61ed38
Show river map only once.
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Tue, 09 Oct 2012 11:02:50 +0200 |
parents | 12245d1386bb |
children | 360e22afb98b |
comparison
equal
deleted
inserted
replaced
4063:7c03d3bd9262 | 4064:61020a61ed38 |
---|---|
6 import com.smartgwt.client.widgets.Canvas; | 6 import com.smartgwt.client.widgets.Canvas; |
7 import com.smartgwt.client.widgets.Img; | 7 import com.smartgwt.client.widgets.Img; |
8 import com.smartgwt.client.widgets.Label; | 8 import com.smartgwt.client.widgets.Label; |
9 import com.smartgwt.client.widgets.form.DynamicForm; | 9 import com.smartgwt.client.widgets.form.DynamicForm; |
10 import com.smartgwt.client.widgets.form.fields.LinkItem; | 10 import com.smartgwt.client.widgets.form.fields.LinkItem; |
11 import com.smartgwt.client.widgets.form.fields.events.ClickEvent; | |
12 import com.smartgwt.client.widgets.form.fields.events.ClickHandler; | |
11 import com.smartgwt.client.widgets.layout.HLayout; | 13 import com.smartgwt.client.widgets.layout.HLayout; |
12 import com.smartgwt.client.widgets.layout.VLayout; | 14 import com.smartgwt.client.widgets.layout.VLayout; |
13 import com.smartgwt.client.widgets.form.fields.events.ClickHandler; | |
14 import com.smartgwt.client.widgets.form.fields.events.ClickEvent; | |
15 | 15 |
16 import de.intevation.flys.client.client.FLYSConstants; | |
17 import de.intevation.flys.client.client.event.StepForwardEvent; | |
16 import de.intevation.flys.client.shared.model.Data; | 18 import de.intevation.flys.client.shared.model.Data; |
17 import de.intevation.flys.client.shared.model.DataItem; | 19 import de.intevation.flys.client.shared.model.DataItem; |
18 import de.intevation.flys.client.shared.model.DataList; | 20 import de.intevation.flys.client.shared.model.DataList; |
19 import de.intevation.flys.client.shared.model.DefaultData; | 21 import de.intevation.flys.client.shared.model.DefaultData; |
20 import de.intevation.flys.client.shared.model.DefaultDataItem; | 22 import de.intevation.flys.client.shared.model.DefaultDataItem; |
21 import de.intevation.flys.client.client.event.StepForwardEvent; | |
22 | |
23 import de.intevation.flys.client.client.FLYSConstants; | |
24 | 23 |
25 | 24 |
26 /** | 25 /** |
27 * This UIProvider displays the DataItems of the Data object in a list of links. | 26 * This UIProvider displays the DataItems of the Data object in a list of links. |
28 * | 27 * |
47 * | 46 * |
48 * @param data The {@link Data} object. | 47 * @param data The {@link Data} object. |
49 * | 48 * |
50 * @return a combobox. | 49 * @return a combobox. |
51 */ | 50 */ |
51 @Override | |
52 public Canvas create(DataList data) { | 52 public Canvas create(DataList data) { |
53 VLayout v = new VLayout(); | 53 VLayout v = new VLayout(); |
54 v.setMembersMargin(10); | 54 v.setMembersMargin(10); |
55 v.setAlign(VerticalAlignment.TOP); | 55 v.setAlign(VerticalAlignment.TOP); |
56 if (data.getState() == null) { | 56 if (data.getState() == null) { |
62 | 62 |
63 return v; | 63 return v; |
64 } | 64 } |
65 | 65 |
66 | 66 |
67 @Override | |
67 public Canvas createOld(DataList dataList) { | 68 public Canvas createOld(DataList dataList) { |
68 HLayout layout = new HLayout(); | 69 HLayout layout = new HLayout(); |
69 VLayout vLayout = new VLayout(); | 70 VLayout vLayout = new VLayout(); |
70 layout.setWidth("400px"); | 71 layout.setWidth("400px"); |
71 | 72 |
103 * | 104 * |
104 * @param data The {@link Data} object. | 105 * @param data The {@link Data} object. |
105 * | 106 * |
106 * @return a list of links | 107 * @return a list of links |
107 */ | 108 */ |
109 @Override | |
108 protected Canvas createWidget(DataList data) { | 110 protected Canvas createWidget(DataList data) { |
109 GWT.log("LinkSelection - create()"); | 111 GWT.log("LinkSelection - create()"); |
110 | 112 |
111 VLayout layout = new VLayout(); | 113 VLayout layout = new VLayout(); |
112 layout.setAlign(VerticalAlignment.TOP); | 114 layout.setAlign(VerticalAlignment.TOP); |
133 link.setShowTitle(false); | 135 link.setShowTitle(false); |
134 DynamicForm f = new DynamicForm(); | 136 DynamicForm f = new DynamicForm(); |
135 f.setItems(link); | 137 f.setItems(link); |
136 formLayout.addMember(f); | 138 formLayout.addMember(f); |
137 link.addClickHandler(new ClickHandler() { | 139 link.addClickHandler(new ClickHandler() { |
140 @Override | |
138 public void onClick(ClickEvent event) { | 141 public void onClick(ClickEvent event) { |
139 DataItem item = new DefaultDataItem( | 142 DataItem item = new DefaultDataItem( |
140 ((LinkItem)event.getItem()).getLinkTitle(), | 143 ((LinkItem)event.getItem()).getLinkTitle(), |
141 null, | 144 null, |
142 ((LinkItem)event.getItem()).getLinkTitle()); | 145 ((LinkItem)event.getItem()).getLinkTitle()); |
164 | 167 |
165 return layout; | 168 return layout; |
166 } | 169 } |
167 | 170 |
168 | 171 |
172 @Override | |
169 protected Data[] getData() { | 173 protected Data[] getData() { |
170 Data[] module = super.getData(); | 174 Data[] module = super.getData(); |
171 if (module != null) { | 175 if (module != null) { |
172 return new Data[] {module[0], river}; | 176 return new Data[] {module[0], river}; |
173 } | 177 } |