Mercurial > dive4elements > river
annotate gwt-client/src/main/java/org/dive4elements/river/client/client/ui/AbstractUIProvider.java @ 9237:972e10522ed6
salix.supraregional ui
author | gernotbelger |
---|---|
date | Tue, 10 Jul 2018 11:24:12 +0200 |
parents | aafae1ab25f0 |
children | 82c67b859aa7 |
rev | line source |
---|---|
5861
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde |
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
2 * Software engineering by Intevation GmbH |
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
3 * |
5993
ea9eef426962
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5861
diff
changeset
|
4 * This file is Free Software under the GNU AGPL (>=v3) |
5861
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
5993
ea9eef426962
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5861
diff
changeset
|
6 * documentation coming with Dive4Elements River for details. |
5861
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
7 */ |
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
8 |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
9 package org.dive4elements.river.client.client.ui; |
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 |
9066 | 11 import java.util.ArrayList; |
12 import java.util.List; | |
4131
360e22afb98b
Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents:
3384
diff
changeset
|
13 |
9066 | 14 import org.dive4elements.river.client.client.FLYS; |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
15 import org.dive4elements.river.client.client.FLYSConstants; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
16 import org.dive4elements.river.client.client.event.HasStepBackHandlers; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
17 import org.dive4elements.river.client.client.event.HasStepForwardHandlers; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
18 import org.dive4elements.river.client.client.event.StepBackEvent; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
19 import org.dive4elements.river.client.client.event.StepBackHandler; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
20 import org.dive4elements.river.client.client.event.StepForwardEvent; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
21 import org.dive4elements.river.client.client.event.StepForwardHandler; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
22 import org.dive4elements.river.client.shared.model.Artifact; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
23 import org.dive4elements.river.client.shared.model.ArtifactDescription; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
24 import org.dive4elements.river.client.shared.model.Collection; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
25 import org.dive4elements.river.client.shared.model.Data; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
26 import org.dive4elements.river.client.shared.model.DataItem; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
27 import org.dive4elements.river.client.shared.model.DataList; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
28 import org.dive4elements.river.client.shared.model.DefaultData; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
29 import org.dive4elements.river.client.shared.model.DefaultDataItem; |
1591
8ab010967f78
Refactored.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1586
diff
changeset
|
30 |
9066 | 31 import com.google.gwt.core.client.GWT; |
32 import com.smartgwt.client.util.SC; | |
33 import com.smartgwt.client.widgets.Button; | |
34 import com.smartgwt.client.widgets.Canvas; | |
35 import com.smartgwt.client.widgets.Img; | |
36 import com.smartgwt.client.widgets.events.ClickEvent; | |
37 import com.smartgwt.client.widgets.events.ClickHandler; | |
38 import com.smartgwt.client.widgets.layout.VLayout; | |
1591
8ab010967f78
Refactored.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1586
diff
changeset
|
39 |
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
|
40 /** |
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 * 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
|
42 * |
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
|
43 * @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
|
44 */ |
9066 | 45 public abstract class AbstractUIProvider implements UIProvider, HasStepForwardHandlers, ClickHandler, HasStepBackHandlers { |
4131
360e22afb98b
Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents:
3384
diff
changeset
|
46 private static final long serialVersionUID = -1610874613377494184L; |
360e22afb98b
Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents:
3384
diff
changeset
|
47 |
5189
60b5fca4f357
Doc Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4131
diff
changeset
|
48 /** 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
|
49 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
|
50 |
5189
60b5fca4f357
Doc Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4131
diff
changeset
|
51 /** The StepForwardHandlers. */ |
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
|
52 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
|
53 |
5189
60b5fca4f357
Doc Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4131
diff
changeset
|
54 /** The StepForwardHandlers. */ |
60
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
55 protected List<StepBackHandler> backHandlers; |
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
56 |
5189
60b5fca4f357
Doc Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4131
diff
changeset
|
57 /** The container that is used to position helper widgets. */ |
788
dfbc6693247e
Integrated a stacked panel on the right side of the ParameterList that enables users to see calculation results and the helper panel at the same time.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
562
diff
changeset
|
58 protected VLayout helperContainer; |
83
4784ca718476
Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
81
diff
changeset
|
59 |
5189
60b5fca4f357
Doc Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4131
diff
changeset
|
60 /** The artifact that contains status information. */ |
233
137daff2c732
Prepared UI elements for the location and distance input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
61 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
|
62 |
5189
60b5fca4f357
Doc Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4131
diff
changeset
|
63 /** The Collection. */ |
909
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
873
diff
changeset
|
64 protected Collection collection; |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
873
diff
changeset
|
65 |
5189
60b5fca4f357
Doc Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4131
diff
changeset
|
66 /** The ParameterList. */ |
915
89a47098bcbd
Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
909
diff
changeset
|
67 protected ParameterList parameterList; |
89a47098bcbd
Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
909
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 * 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
|
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 public AbstractUIProvider() { |
9066 | 73 this.forwardHandlers = new ArrayList<StepForwardHandler>(); |
74 this.backHandlers = new ArrayList<StepBackHandler>(); | |
60
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
75 } |
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
76 |
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
77 /** |
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
78 * 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
|
79 * |
9066 | 80 * @param handler |
81 * A new StepBackHandler. | |
60
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
82 */ |
3384
a6b7f0585761
Merge point/line label styles
Christian Lins <christian.lins@intevation.de>
parents:
2500
diff
changeset
|
83 @Override |
9066 | 84 public void addStepBackHandler(final StepBackHandler handler) { |
60
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
85 if (handler != null) { |
9066 | 86 this.backHandlers.add(handler); |
60
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
87 } |
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
|
88 } |
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
|
89 |
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
|
90 /** |
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
|
91 * 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
|
92 * |
9066 | 93 * @param handler |
94 * A new StepForwardHandler. | |
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
|
95 */ |
3384
a6b7f0585761
Merge point/line label styles
Christian Lins <christian.lins@intevation.de>
parents:
2500
diff
changeset
|
96 @Override |
9066 | 97 public void addStepForwardHandler(final StepForwardHandler handler) { |
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
|
98 if (handler != null) { |
9066 | 99 this.forwardHandlers.add(handler); |
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
|
100 } |
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 |
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 /** |
60
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
104 * 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
|
105 * 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
|
106 * |
9066 | 107 * @param e |
108 * The StepBackEvent. | |
60
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
109 */ |
9066 | 110 protected void fireStepBackEvent(final StepBackEvent e) { |
111 GWT.log("AbstractUIProvider - fireStepBackEvent() handlers: " + this.backHandlers.size()); | |
112 for (final StepBackHandler handler : this.backHandlers) { | |
60
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
113 handler.onStepBack(e); |
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
114 } |
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
115 } |
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
116 |
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
117 /** |
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
|
118 * 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
|
119 * 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
|
120 * |
9066 | 121 * @param e |
122 * The StepForwardEvent. | |
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
|
123 */ |
9066 | 124 protected void fireStepForwardEvent(final StepForwardEvent e) { |
125 GWT.log("AbstractUIProvider - fireStepForwardEvent() handlers: " + this.forwardHandlers.size()); | |
126 for (final StepForwardHandler handler : this.forwardHandlers) { | |
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
|
127 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
|
128 } |
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
|
129 } |
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
|
130 |
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
|
131 /** |
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
|
132 * 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
|
133 * 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
|
134 * |
9066 | 135 * @param e |
136 * The click event. | |
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
|
137 */ |
3384
a6b7f0585761
Merge point/line label styles
Christian Lins <christian.lins@intevation.de>
parents:
2500
diff
changeset
|
138 @Override |
9066 | 139 public void onClick(final ClickEvent e) { |
140 final List<String> errors = validate(); | |
9079 | 141 if (errors == null || errors.isEmpty()) { |
142 final Data[] data = getData(); | |
143 fireStepForwardEvent(new StepForwardEvent(data)); | |
144 } else { | |
145 showErrors(errors); | |
146 } | |
909
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
873
diff
changeset
|
147 } |
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
|
148 |
9066 | 149 protected void showErrors(final List<String> errors) { |
150 final StringBuilder sb = new StringBuilder(); | |
562
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
247
diff
changeset
|
151 |
9066 | 152 for (final String error : errors) { |
909
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
873
diff
changeset
|
153 sb.append(error); |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
873
diff
changeset
|
154 sb.append("<br>"); |
562
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
247
diff
changeset
|
155 } |
909
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
873
diff
changeset
|
156 |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
873
diff
changeset
|
157 SC.warn(sb.toString()); |
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
|
158 } |
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
|
159 |
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
|
160 /** |
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
|
161 * 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
|
162 * |
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
|
163 * @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
|
164 */ |
57
246af33f621c
Adjusted the look of the 'next' button in the parameter panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
165 protected Canvas getNextButton() { |
9066 | 166 final Button next = new Button(this.MSG.buttonNext()); |
81
1d0fb625248d
Replaced next button image with smart gwt button.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
60
diff
changeset
|
167 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
|
168 |
81
1d0fb625248d
Replaced next button image with smart gwt button.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
60
diff
changeset
|
169 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
|
170 } |
246af33f621c
Adjusted the look of the 'next' button in the parameter panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
171 |
2500
69a498896c9c
Create a link to an online help page and put it in front of the input panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1591
diff
changeset
|
172 @Override |
9066 | 173 public Canvas createHelpLink(final DataList dataList, final Data data, final FLYS instance) { |
174 final String iUrl = GWT.getHostPageBaseURL() + this.MSG.getFeatureInfo(); | |
175 final String helpUrl = dataList.getHelpText(); | |
2500
69a498896c9c
Create a link to an online help page and put it in front of the input panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1591
diff
changeset
|
176 |
6232
175df4c01ae7
Use WikiLink class for Help links
Andre Heinecke <aheinecke@intevation.de>
parents:
5993
diff
changeset
|
177 return new WikiImgLink(iUrl, helpUrl, 30, 30, instance); |
2500
69a498896c9c
Create a link to an online help page and put it in front of the input panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1591
diff
changeset
|
178 } |
69a498896c9c
Create a link to an online help page and put it in front of the input panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1591
diff
changeset
|
179 |
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
|
180 /** |
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
|
181 * 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
|
182 * |
9066 | 183 * @param targetState |
184 * The identifier of the target state. | |
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
|
185 * |
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
|
186 * @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
|
187 */ |
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
|
188 protected Canvas getBackButton(final String targetState) { |
9066 | 189 final String url = GWT.getHostPageBaseURL() + this.MSG.imageBack(); |
190 final 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
|
191 |
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
|
192 back.addClickHandler(new ClickHandler() { |
3384
a6b7f0585761
Merge point/line label styles
Christian Lins <christian.lins@intevation.de>
parents:
2500
diff
changeset
|
193 @Override |
9066 | 194 public void onClick(final ClickEvent event) { |
60
f793d35bfb08
Implemented a mechanism to step back to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
195 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
|
196 } |
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
|
197 }); |
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
|
198 |
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
|
199 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
|
200 } |
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
|
201 |
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
|
202 /** |
83
4784ca718476
Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
81
diff
changeset
|
203 * 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
|
204 * |
9066 | 205 * @param helperContainer |
206 * A container that is used to position helper | |
207 * widgets. | |
83
4784ca718476
Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
81
diff
changeset
|
208 */ |
3384
a6b7f0585761
Merge point/line label styles
Christian Lins <christian.lins@intevation.de>
parents:
2500
diff
changeset
|
209 @Override |
9066 | 210 public void setContainer(final VLayout helperContainer) { |
83
4784ca718476
Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
81
diff
changeset
|
211 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
|
212 } |
4784ca718476
Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
81
diff
changeset
|
213 |
4784ca718476
Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
81
diff
changeset
|
214 /** |
233
137daff2c732
Prepared UI elements for the location and distance input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
215 * 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
|
216 * |
9066 | 217 * @param art |
218 * An artifact containing status information. | |
233
137daff2c732
Prepared UI elements for the location and distance input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
219 */ |
3384
a6b7f0585761
Merge point/line label styles
Christian Lins <christian.lins@intevation.de>
parents:
2500
diff
changeset
|
220 @Override |
9066 | 221 public void setArtifact(final Artifact art) { |
233
137daff2c732
Prepared UI elements for the location and distance input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
222 this.artifact = art; |
137daff2c732
Prepared UI elements for the location and distance input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
223 } |
137daff2c732
Prepared UI elements for the location and distance input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
224 |
3384
a6b7f0585761
Merge point/line label styles
Christian Lins <christian.lins@intevation.de>
parents:
2500
diff
changeset
|
225 @Override |
9066 | 226 public void setCollection(final Collection collection) { |
909
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
873
diff
changeset
|
227 this.collection = collection; |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
873
diff
changeset
|
228 } |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
873
diff
changeset
|
229 |
3384
a6b7f0585761
Merge point/line label styles
Christian Lins <christian.lins@intevation.de>
parents:
2500
diff
changeset
|
230 @Override |
9066 | 231 public void setParameterList(final ParameterList list) { |
915
89a47098bcbd
Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
909
diff
changeset
|
232 this.parameterList = list; |
89a47098bcbd
Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
909
diff
changeset
|
233 } |
89a47098bcbd
Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
909
diff
changeset
|
234 |
909
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
873
diff
changeset
|
235 public Collection getCollection() { |
9066 | 236 return this.collection; |
909
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
873
diff
changeset
|
237 } |
794d1af42987
Clone Artifacts and add them to the current Collection in the WspDatacagePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
873
diff
changeset
|
238 |
233
137daff2c732
Prepared UI elements for the location and distance input tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
211
diff
changeset
|
239 /** |
247
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
240 * 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
|
241 * returns it. |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
242 * |
9066 | 243 * @param items |
244 * A list of Data. | |
245 * @param name | |
246 * The name of the Data that we are searching for. | |
247
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
247 * |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
248 * @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
|
249 */ |
9066 | 250 protected Data getData(final List<Data> data, final String name) { |
251 for (final Data d : data) { | |
247
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
252 if (name.equals(d.getLabel())) { |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
253 return d; |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
254 } |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
255 } |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
256 return null; |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
257 } |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
258 |
9066 | 259 protected String getDataValue(final String state, final String name) { |
260 final ArtifactDescription desc = this.artifact.getArtifactDescription(); | |
873
77a549772aa9
Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
788
diff
changeset
|
261 |
9066 | 262 final DataList[] old = desc.getOldData(); |
873
77a549772aa9
Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
788
diff
changeset
|
263 |
9066 | 264 for (final DataList list : old) { |
5308
7712dacc27ab
Avoid NPE if data list is null.
Raimund Renkert <rrenkert@intevation.de>
parents:
5189
diff
changeset
|
265 if (list == null) { |
7712dacc27ab
Avoid NPE if data list is null.
Raimund Renkert <rrenkert@intevation.de>
parents:
5189
diff
changeset
|
266 continue; |
7712dacc27ab
Avoid NPE if data list is null.
Raimund Renkert <rrenkert@intevation.de>
parents:
5189
diff
changeset
|
267 } |
9066 | 268 final Data d = getData(list.getAll(), name); |
873
77a549772aa9
Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
788
diff
changeset
|
269 |
77a549772aa9
Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
788
diff
changeset
|
270 if (d != null) { |
77a549772aa9
Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
788
diff
changeset
|
271 return d.getItems()[0].getStringValue(); |
77a549772aa9
Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
788
diff
changeset
|
272 } |
77a549772aa9
Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
788
diff
changeset
|
273 } |
77a549772aa9
Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
788
diff
changeset
|
274 |
77a549772aa9
Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
788
diff
changeset
|
275 return null; |
77a549772aa9
Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
788
diff
changeset
|
276 } |
77a549772aa9
Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
788
diff
changeset
|
277 |
247
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
278 /** |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
279 * 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
|
280 * returns it. |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
281 * |
9066 | 282 * @param items |
283 * A list of DataItems. | |
284 * @param name | |
285 * The name of the DataItem that we are searching for. | |
247
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
286 * |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
287 * @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
|
288 */ |
9066 | 289 protected DataItem getDataItem(final DataItem[] items, final String name) { |
290 for (final DataItem item : items) { | |
247
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
291 if (name.equals(item.getLabel())) { |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
292 return item; |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
293 } |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
294 } |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
295 |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
296 return null; |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
297 } |
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
298 |
8852
8f6d6d26e96f
Refaktored the DatacageTwinPanel so it is reusable.
gernotbelger
parents:
6232
diff
changeset
|
299 /** |
8f6d6d26e96f
Refaktored the DatacageTwinPanel so it is reusable.
gernotbelger
parents:
6232
diff
changeset
|
300 * Validates the selection. |
9074 | 301 * |
8852
8f6d6d26e96f
Refaktored the DatacageTwinPanel so it is reusable.
gernotbelger
parents:
6232
diff
changeset
|
302 * @return List of internationalized errror messages (if any). |
8f6d6d26e96f
Refaktored the DatacageTwinPanel so it is reusable.
gernotbelger
parents:
6232
diff
changeset
|
303 */ |
562
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
247
diff
changeset
|
304 public List<String> validate() { |
5658
995320711d80
Temporary remove classification from floodmap plane theme editor (#801).
Christian Lins <christian.lins@intevation.de>
parents:
5308
diff
changeset
|
305 return new ArrayList<String>(); // FIXME: What's this? |
562
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
247
diff
changeset
|
306 } |
9f16ac843dda
Introduced a client side validation before new user data are sent to the server - the range/location panel already implements this validation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
247
diff
changeset
|
307 |
1591
8ab010967f78
Refactored.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1586
diff
changeset
|
308 /** Create simple DefaultData with single DataItem inside. */ |
9066 | 309 public static DefaultData createDataArray(final String name, final String value) { |
310 final DataItem item = new DefaultDataItem(name, name, value); | |
1591
8ab010967f78
Refactored.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1586
diff
changeset
|
311 |
9066 | 312 return new DefaultData(name, null, null, new DataItem[] { item }); |
1591
8ab010967f78
Refactored.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1586
diff
changeset
|
313 } |
8ab010967f78
Refactored.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1586
diff
changeset
|
314 |
247
4a684d29404f
Implemented the createOld() of WQAdaptedInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
315 /** |
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
|
316 * 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
|
317 * 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
|
318 * |
9066 | 319 * @param data |
320 * The data that should be displayed. | |
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
|
321 * |
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
|
322 * @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
|
323 */ |
3384
a6b7f0585761
Merge point/line label styles
Christian Lins <christian.lins@intevation.de>
parents:
2500
diff
changeset
|
324 @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:
41
diff
changeset
|
325 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
|
326 |
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
|
327 /** |
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
|
328 * 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
|
329 * 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
|
330 * |
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
|
331 * @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
|
332 */ |
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
|
333 protected abstract Data[] getData(); |
9237 | 334 |
335 protected String getRiverName() { | |
336 final ArtifactDescription adescr = this.artifact.getArtifactDescription(); | |
337 return adescr.getRiver(); | |
338 } | |
339 | |
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
|
340 } |
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
|
341 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |