comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/AbstractUIProvider.java @ 3384:a6b7f0585761

Merge point/line label styles flys-client/trunk@5133 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Christian Lins <christian.lins@intevation.de>
date Thu, 26 Jul 2012 10:05:50 +0000
parents 69a498896c9c
children 360e22afb98b
comparison
equal deleted inserted replaced
3383:dc48bc58102f 3384:a6b7f0585761
1 package de.intevation.flys.client.client.ui; 1 package de.intevation.flys.client.client.ui;
2 2
3 import java.util.ArrayList;
4 import java.util.List;
5
6 import com.google.gwt.core.client.GWT; 3 import com.google.gwt.core.client.GWT;
7
8 import com.smartgwt.client.util.SC; 4 import com.smartgwt.client.util.SC;
9 import com.smartgwt.client.widgets.Button; 5 import com.smartgwt.client.widgets.Button;
10 import com.smartgwt.client.widgets.Canvas; 6 import com.smartgwt.client.widgets.Canvas;
11 import com.smartgwt.client.widgets.Img; 7 import com.smartgwt.client.widgets.Img;
12 import com.smartgwt.client.widgets.events.ClickEvent; 8 import com.smartgwt.client.widgets.events.ClickEvent;
24 import de.intevation.flys.client.shared.model.ArtifactDescription; 20 import de.intevation.flys.client.shared.model.ArtifactDescription;
25 import de.intevation.flys.client.shared.model.Collection; 21 import de.intevation.flys.client.shared.model.Collection;
26 import de.intevation.flys.client.shared.model.Data; 22 import de.intevation.flys.client.shared.model.Data;
27 import de.intevation.flys.client.shared.model.DataItem; 23 import de.intevation.flys.client.shared.model.DataItem;
28 import de.intevation.flys.client.shared.model.DataList; 24 import de.intevation.flys.client.shared.model.DataList;
29
30 import de.intevation.flys.client.shared.model.DefaultData; 25 import de.intevation.flys.client.shared.model.DefaultData;
31 import de.intevation.flys.client.shared.model.DefaultDataItem; 26 import de.intevation.flys.client.shared.model.DefaultDataItem;
27
28 import java.util.ArrayList;
29 import java.util.List;
32 30
33 31
34 /** 32 /**
35 * An abstract UIProvider that provides some basic methods. 33 * An abstract UIProvider that provides some basic methods.
36 * 34 *
73 /** 71 /**
74 * Appends a StepBackHandler that wants to listen to StepBackEvents. 72 * Appends a StepBackHandler that wants to listen to StepBackEvents.
75 * 73 *
76 * @param handler A new StepBackHandler. 74 * @param handler A new StepBackHandler.
77 */ 75 */
76 @Override
78 public void addStepBackHandler(StepBackHandler handler) { 77 public void addStepBackHandler(StepBackHandler handler) {
79 if (handler != null) { 78 if (handler != null) {
80 backHandlers.add(handler); 79 backHandlers.add(handler);
81 } 80 }
82 } 81 }
85 /** 84 /**
86 * Appends a StepForwardHandler that wants to listen to StepForwardEvents. 85 * Appends a StepForwardHandler that wants to listen to StepForwardEvents.
87 * 86 *
88 * @param handler A new StepForwardHandler. 87 * @param handler A new StepForwardHandler.
89 */ 88 */
89 @Override
90 public void addStepForwardHandler(StepForwardHandler handler) { 90 public void addStepForwardHandler(StepForwardHandler handler) {
91 if (handler != null) { 91 if (handler != null) {
92 forwardHandlers.add(handler); 92 forwardHandlers.add(handler);
93 } 93 }
94 } 94 }
126 * This method is used to listen to click events on the 'next' button. The 126 * This method is used to listen to click events on the 'next' button. The
127 * fireStepForwardEvent() method is called here. 127 * fireStepForwardEvent() method is called here.
128 * 128 *
129 * @param e The click event. 129 * @param e The click event.
130 */ 130 */
131 @Override
131 public void onClick(ClickEvent e) { 132 public void onClick(ClickEvent e) {
132 List<String> errors = validate(); 133 List<String> errors = validate();
133 if (errors == null || errors.isEmpty()) { 134 if (errors == null || errors.isEmpty()) {
134 Data[] data = getData(); 135 Data[] data = getData();
135 fireStepForwardEvent(new StepForwardEvent(data)); 136 fireStepForwardEvent(new StepForwardEvent(data));
184 protected Canvas getBackButton(final String targetState) { 185 protected Canvas getBackButton(final String targetState) {
185 String url = GWT.getHostPageBaseURL() + MSG.imageBack(); 186 String url = GWT.getHostPageBaseURL() + MSG.imageBack();
186 Img back = new Img(url, 16, 16); 187 Img back = new Img(url, 16, 16);
187 188
188 back.addClickHandler(new ClickHandler() { 189 back.addClickHandler(new ClickHandler() {
190 @Override
189 public void onClick(ClickEvent event) { 191 public void onClick(ClickEvent event) {
190 fireStepBackEvent(new StepBackEvent(targetState)); 192 fireStepBackEvent(new StepBackEvent(targetState));
191 } 193 }
192 }); 194 });
193 195
199 * This method injects a container that is used to position helper widgets. 201 * This method injects a container that is used to position helper widgets.
200 * 202 *
201 * @param helperContainer A container that is used to position helper 203 * @param helperContainer A container that is used to position helper
202 * widgets. 204 * widgets.
203 */ 205 */
206 @Override
204 public void setContainer(VLayout helperContainer) { 207 public void setContainer(VLayout helperContainer) {
205 this.helperContainer = helperContainer; 208 this.helperContainer = helperContainer;
206 } 209 }
207 210
208 211
209 /** 212 /**
210 * This method injects an artifact that contains the status information. 213 * This method injects an artifact that contains the status information.
211 * 214 *
212 * @param art An artifact containing status information. 215 * @param art An artifact containing status information.
213 */ 216 */
217 @Override
214 public void setArtifact(Artifact art) { 218 public void setArtifact(Artifact art) {
215 this.artifact = art; 219 this.artifact = art;
216 } 220 }
217 221
218 222
223 @Override
219 public void setCollection(Collection collection) { 224 public void setCollection(Collection collection) {
220 this.collection = collection; 225 this.collection = collection;
221 } 226 }
222 227
223 228
229 @Override
224 public void setParameterList(ParameterList list) { 230 public void setParameterList(ParameterList list) {
225 this.parameterList = list; 231 this.parameterList = list;
226 } 232 }
227 233
228 234
312 * 318 *
313 * @param data The data that should be displayed. 319 * @param data The data that should be displayed.
314 * 320 *
315 * @return a Canvas object that displays <i>data</i>. 321 * @return a Canvas object that displays <i>data</i>.
316 */ 322 */
323 @Override
317 public abstract Canvas create(DataList data); 324 public abstract Canvas create(DataList data);
318 325
319 326
320 /** 327 /**
321 * This method needs to be implemented by concrete subclasses. It should 328 * This method needs to be implemented by concrete subclasses. It should

http://dive4elements.wald.intevation.org