Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterList.java @ 72:9b726350ab07
Moved ParameterList specific code into the ParameterList.
flys-client/trunk@1575 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Sat, 26 Mar 2011 18:07:41 +0000 |
parents | f793d35bfb08 |
children | 39210a74db07 |
comparison
equal
deleted
inserted
replaced
71:987567f31200 | 72:9b726350ab07 |
---|---|
8 import com.smartgwt.client.types.VerticalAlignment; | 8 import com.smartgwt.client.types.VerticalAlignment; |
9 import com.smartgwt.client.widgets.Canvas; | 9 import com.smartgwt.client.widgets.Canvas; |
10 import com.smartgwt.client.widgets.layout.HLayout; | 10 import com.smartgwt.client.widgets.layout.HLayout; |
11 import com.smartgwt.client.widgets.layout.VLayout; | 11 import com.smartgwt.client.widgets.layout.VLayout; |
12 | 12 |
13 import de.intevation.flys.client.shared.model.Artifact; | |
14 import de.intevation.flys.client.shared.model.ArtifactDescription; | |
13 import de.intevation.flys.client.shared.model.Data; | 15 import de.intevation.flys.client.shared.model.Data; |
14 import de.intevation.flys.client.shared.model.DataList; | 16 import de.intevation.flys.client.shared.model.DataList; |
15 import de.intevation.flys.client.client.event.HasStepBackHandlers; | 17 import de.intevation.flys.client.client.event.HasStepBackHandlers; |
18 import de.intevation.flys.client.client.event.HasStepForwardHandlers; | |
19 import de.intevation.flys.client.client.event.ParameterChangeEvent; | |
20 import de.intevation.flys.client.client.event.ParameterChangeHandler; | |
16 import de.intevation.flys.client.client.event.StepBackEvent; | 21 import de.intevation.flys.client.client.event.StepBackEvent; |
17 import de.intevation.flys.client.client.event.StepBackHandler; | 22 import de.intevation.flys.client.client.event.StepBackHandler; |
18 | 23 |
19 | 24 |
20 public class ParameterList | 25 public class ParameterList |
21 extends VLayout | 26 extends VLayout |
22 implements StepBackHandler | 27 implements StepBackHandler, ParameterChangeHandler |
23 { | 28 { |
24 protected CollectionView cView; | 29 protected CollectionView cView; |
25 | 30 |
26 protected List<DataList> old; | 31 protected List<DataList> old; |
27 protected DataList current; | 32 protected DataList current; |
159 */ | 164 */ |
160 public void onStepBack(StepBackEvent e) { | 165 public void onStepBack(StepBackEvent e) { |
161 old.clear(); | 166 old.clear(); |
162 oldItems.removeMembers(oldItems.getMembers()); | 167 oldItems.removeMembers(oldItems.getMembers()); |
163 } | 168 } |
169 | |
170 | |
171 /** | |
172 * Implements the onCollectionChange() method to do update the GUI after the | |
173 * parameterization has changed. | |
174 * | |
175 * @param event The ParameterChangeEvent. | |
176 */ | |
177 public void onParameterChange(ParameterChangeEvent event) { | |
178 GWT.log("ParameterList.onParameterChange"); | |
179 | |
180 Artifact art = event.getNewValue(); | |
181 ArtifactDescription desc = art.getArtifactDescription(); | |
182 | |
183 DataList currentData = desc.getCurrentData(); | |
184 if (currentData != null) { | |
185 // the user has to enter some attributes | |
186 String uiProvider = currentData.getUIProvider(); | |
187 UIProvider provider = UIProviderFactory.getProvider(uiProvider); | |
188 | |
189 ((HasStepForwardHandlers) provider).addStepForwardHandler(cView); | |
190 ((HasStepBackHandlers) provider).addStepBackHandler(cView); | |
191 | |
192 setCurrentData(currentData, provider); | |
193 } | |
194 else { | |
195 // we have reached a final state with no more user input | |
196 setCurrentData(null, null); | |
197 } | |
198 | |
199 addOldDatas(desc.getOldData()); | |
200 } | |
164 } | 201 } |
165 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 202 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |