annotate flys-client/src/main/java/de/intevation/flys/client/client/ui/AbstractUIProvider.java @ 247:4a684d29404f

Implemented the createOld() of WQAdaptedInputPanel. flys-client/trunk@1832 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 05 May 2011 09:33:15 +0000
parents 137daff2c732
children 9f16ac843dda
rev   line source
41
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.client.client.ui;
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
2
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
3 import java.util.ArrayList;
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
4 import java.util.List;
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
5
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
6 import com.google.gwt.core.client.GWT;
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
7
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
8 import com.smartgwt.client.widgets.Canvas;
57
246af33f621c Adjusted the look of the 'next' button in the parameter panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
9 import com.smartgwt.client.widgets.Img;
41
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
10 import com.smartgwt.client.widgets.events.ClickEvent;
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
11 import com.smartgwt.client.widgets.events.ClickHandler;
81
1d0fb625248d Replaced next button image with smart gwt button.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 60
diff changeset
12 import com.smartgwt.client.widgets.Button;
41
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
13
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: 89
diff changeset
14 import de.intevation.flys.client.client.FLYSConstants;
60
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
15 import de.intevation.flys.client.client.event.HasStepBackHandlers;
41
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
16 import de.intevation.flys.client.client.event.HasStepForwardHandlers;
60
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
17 import de.intevation.flys.client.client.event.StepBackEvent;
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
18 import de.intevation.flys.client.client.event.StepBackHandler;
41
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
19 import de.intevation.flys.client.client.event.StepForwardEvent;
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
20 import de.intevation.flys.client.client.event.StepForwardHandler;
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
21 import de.intevation.flys.client.shared.model.Data;
247
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
22 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: 41
diff changeset
23 import de.intevation.flys.client.shared.model.DataList;
233
137daff2c732 Prepared UI elements for the location and distance input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 211
diff changeset
24 import de.intevation.flys.client.shared.model.Artifact;
41
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
25
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
26 /**
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
27 * An abstract UIProvider that provides some basic methods.
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
28 *
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
29 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
30 */
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
31 public abstract class AbstractUIProvider
60
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
32 implements UIProvider, HasStepForwardHandlers, ClickHandler,
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
33 HasStepBackHandlers
41
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
34 {
57
246af33f621c Adjusted the look of the 'next' button in the parameter panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
35 /** 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: 89
diff changeset
36 protected FLYSConstants MSG = GWT.create(FLYSConstants.class);
57
246af33f621c Adjusted the look of the 'next' button in the parameter panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
37
246af33f621c Adjusted the look of the 'next' button in the parameter panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
38
41
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
39 /** The StepForwardHandlers.*/
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
40 protected List<StepForwardHandler> forwardHandlers;
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
41
60
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
42 /** The StepForwardHandlers.*/
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
43 protected List<StepBackHandler> backHandlers;
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
44
83
4784ca718476 Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 81
diff changeset
45 /** The container that is used to position helper widgets.*/
4784ca718476 Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 81
diff changeset
46 protected Canvas helperContainer;
4784ca718476 Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 81
diff changeset
47
233
137daff2c732 Prepared UI elements for the location and distance input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 211
diff changeset
48 /** The artifact that contains status information.*/
137daff2c732 Prepared UI elements for the location and distance input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 211
diff changeset
49 protected Artifact artifact;
41
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
50
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
51 /**
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
52 * Creates a new UIProvider instance of this class.
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
53 */
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
54 public AbstractUIProvider() {
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
55 forwardHandlers = new ArrayList<StepForwardHandler>();
60
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
56 backHandlers = new ArrayList<StepBackHandler>();
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
57 }
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
58
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
59
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
60 /**
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
61 * Appends a StepBackHandler that wants to listen to StepBackEvents.
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
62 *
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
63 * @param handler A new StepBackHandler.
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
64 */
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
65 public void addStepBackHandler(StepBackHandler handler) {
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
66 if (handler != null) {
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
67 backHandlers.add(handler);
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
68 }
41
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
69 }
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
70
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
71
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
72 /**
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
73 * Appends a StepForwardHandler that wants to listen to StepForwardEvents.
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
74 *
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
75 * @param handler A new StepForwardHandler.
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
76 */
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
77 public void addStepForwardHandler(StepForwardHandler handler) {
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
78 if (handler != null) {
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
79 forwardHandlers.add(handler);
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
80 }
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
81 }
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
82
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
83
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
84 /**
60
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
85 * This method is called after the user has clicked one of the buttons to
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
86 * step back to a previous state.
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
87 *
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
88 * @param e The StepBackEvent.
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
89 */
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
90 protected void fireStepBackEvent(StepBackEvent e) {
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
91 GWT.log("AbstractUIProvider - fireStepBackEvent() handlers: " + backHandlers.size());
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
92 for (StepBackHandler handler: backHandlers) {
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
93 handler.onStepBack(e);
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
94 }
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
95 }
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
96
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
97
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
98 /**
41
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
99 * This method is called after the user has clicked on the 'next' button to
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
100 * step to the next state.
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
101 *
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
102 * @param e The StepForwardEvent.
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
103 */
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
104 protected void fireStepForwardEvent(StepForwardEvent e) {
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
105 GWT.log("AbstractUIProvider - fireStepForwardEvent() handlers: " + forwardHandlers.size());
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
106 for (StepForwardHandler handler: forwardHandlers) {
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
107 handler.onStepForward(e);
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
108 }
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
109 }
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
110
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
111
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
112 /**
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
113 * This method is used to listen to click events on the 'next' button. The
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
114 * fireStepForwardEvent() method is called here.
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
115 *
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
116 * @param e The click event.
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
117 */
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
118 public void onClick(ClickEvent e) {
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
119 Data[] data = getData();
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
120
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
121 fireStepForwardEvent(new StepForwardEvent(data));
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
122 }
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
123
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
124
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
125 /**
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
126 * Creates the 'next' button to step forward to the next state.
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
127 *
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
128 * @return the 'next' button.
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
129 */
57
246af33f621c Adjusted the look of the 'next' button in the parameter panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
130 protected Canvas getNextButton() {
81
1d0fb625248d Replaced next button image with smart gwt button.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 60
diff changeset
131 Button next = new Button(MSG.buttonNext());
1d0fb625248d Replaced next button image with smart gwt button.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 60
diff changeset
132 next.addClickHandler(this);
57
246af33f621c Adjusted the look of the 'next' button in the parameter panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
133
81
1d0fb625248d Replaced next button image with smart gwt button.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 60
diff changeset
134 return next;
57
246af33f621c Adjusted the look of the 'next' button in the parameter panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
135 }
246af33f621c Adjusted the look of the 'next' button in the parameter panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
136
246af33f621c Adjusted the look of the 'next' button in the parameter panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
137
41
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
138 /**
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
139 * Creates the 'back' button to step back to a previous state.
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
140 *
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
141 * @param targetState The identifier of the target state.
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
142 *
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
143 * @return the 'back' button.
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
144 */
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
145 protected Canvas getBackButton(final String targetState) {
89
131e3f23a74e Modified the URL of the 'back button' image.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 83
diff changeset
146 String url = GWT.getHostPageBaseURL() + MSG.imageBack();
131e3f23a74e Modified the URL of the 'back button' image.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 83
diff changeset
147 Img back = new Img(url, 16, 16);
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
148
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
149 back.addClickHandler(new ClickHandler() {
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
150 public void onClick(ClickEvent event) {
60
f793d35bfb08 Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
151 fireStepBackEvent(new StepBackEvent(targetState));
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
152 }
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
153 });
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
154
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
155 return back;
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
156 }
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
157
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
158
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
159 /**
83
4784ca718476 Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 81
diff changeset
160 * This method injects a container that is used to position helper widgets.
4784ca718476 Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 81
diff changeset
161 *
4784ca718476 Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 81
diff changeset
162 * @param helperContainer A container that is used to position helper
4784ca718476 Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 81
diff changeset
163 * widgets.
4784ca718476 Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 81
diff changeset
164 */
4784ca718476 Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 81
diff changeset
165 public void setContainer(Canvas helperContainer) {
4784ca718476 Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 81
diff changeset
166 this.helperContainer = helperContainer;
4784ca718476 Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 81
diff changeset
167 }
4784ca718476 Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 81
diff changeset
168
4784ca718476 Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 81
diff changeset
169
4784ca718476 Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 81
diff changeset
170 /**
233
137daff2c732 Prepared UI elements for the location and distance input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 211
diff changeset
171 * This method injects an artifact that contains the status information.
137daff2c732 Prepared UI elements for the location and distance input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 211
diff changeset
172 *
137daff2c732 Prepared UI elements for the location and distance input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 211
diff changeset
173 * @param art An artifact containing status information.
137daff2c732 Prepared UI elements for the location and distance input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 211
diff changeset
174 */
137daff2c732 Prepared UI elements for the location and distance input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 211
diff changeset
175 public void setArtifact(Artifact art) {
137daff2c732 Prepared UI elements for the location and distance input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 211
diff changeset
176 this.artifact = art;
137daff2c732 Prepared UI elements for the location and distance input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 211
diff changeset
177 }
137daff2c732 Prepared UI elements for the location and distance input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 211
diff changeset
178
137daff2c732 Prepared UI elements for the location and distance input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 211
diff changeset
179
137daff2c732 Prepared UI elements for the location and distance input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 211
diff changeset
180 /**
247
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
181 * This method greps the Data with name <i>name</i> from the list and
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
182 * returns it.
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
183 *
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
184 * @param items A list of Data.
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
185 * @param name The name of the Data that we are searching for.
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
186 *
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
187 * @return the Data with the name <i>name</i>.
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
188 */
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
189 protected Data getData(List<Data> data, String name) {
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
190 for (Data d: data) {
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
191 if (name.equals(d.getLabel())) {
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
192 return d;
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
193 }
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
194 }
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
195
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
196 return null;
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
197 }
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
198
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
199 /**
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
200 * This method greps the DataItem with name <i>name</i> from the list and
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
201 * returns it.
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
202 *
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
203 * @param items A list of DataItems.
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
204 * @param name The name of the DataItem that we are searching for.
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
205 *
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
206 * @return the DataItem with the name <i>name</i>.
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
207 */
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
208 protected DataItem getDataItem(DataItem[] items, String name) {
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
209 for (DataItem item: items) {
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
210 if (name.equals(item.getLabel())) {
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
211 return item;
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
212 }
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
213 }
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
214
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
215 return null;
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
216 }
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
217
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
218
4a684d29404f Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
219 /**
41
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
220 * This method needs to be implemented by concrete subclasses. It should
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
221 * create a new Canvas object with a representation of <i>data</i>.
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
222 *
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
223 * @param data The data that should be displayed.
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
224 *
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
225 * @return a Canvas object that displays <i>data</i>.
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
226 */
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: 41
diff changeset
227 public abstract Canvas create(DataList data);
41
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
228
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
229
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
230 /**
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
231 * This method needs to be implemented by concrete subclasses. It should
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
232 * return the selected data.
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
233 *
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
234 * @return the selected data.
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
235 */
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
236 protected abstract Data[] getData();
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
237 }
87a44f8e25cc Added a new widget that enables the user to enter a location or a distance in a single step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
238 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org