Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/WspDatacagePanel.java @ 4130:df8ac7ff6b1a
Improve warning when user does not select a waterlevel calculation (#914)
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Sun, 14 Oct 2012 14:44:28 +0200 |
parents | ebf47e4adea5 |
children |
comparison
equal
deleted
inserted
replaced
4129:989f6f0d1986 | 4130:df8ac7ff6b1a |
---|---|
1 package de.intevation.flys.client.client.ui; | 1 package de.intevation.flys.client.client.ui; |
2 | |
3 import java.util.List; | |
4 import java.util.Map; | |
5 import java.util.Set; | |
6 | 2 |
7 import com.google.gwt.core.client.GWT; | 3 import com.google.gwt.core.client.GWT; |
8 import com.google.gwt.user.client.rpc.AsyncCallback; | 4 import com.google.gwt.user.client.rpc.AsyncCallback; |
9 | 5 |
10 import com.smartgwt.client.util.SC; | 6 import com.smartgwt.client.util.SC; |
11 import com.smartgwt.client.widgets.events.ClickEvent; | 7 import com.smartgwt.client.widgets.events.ClickEvent; |
12 | 8 |
9 import de.intevation.flys.client.client.Config; | |
10 import de.intevation.flys.client.client.FLYS; | |
11 import de.intevation.flys.client.client.FLYSConstants; | |
12 import de.intevation.flys.client.client.event.StepForwardEvent; | |
13 import de.intevation.flys.client.client.services.LoadArtifactService; | |
14 import de.intevation.flys.client.client.services.LoadArtifactServiceAsync; | |
13 import de.intevation.flys.client.shared.model.Artifact; | 15 import de.intevation.flys.client.shared.model.Artifact; |
14 import de.intevation.flys.client.shared.model.Collection; | 16 import de.intevation.flys.client.shared.model.Collection; |
15 import de.intevation.flys.client.shared.model.Data; | 17 import de.intevation.flys.client.shared.model.Data; |
16 import de.intevation.flys.client.shared.model.DataItem; | 18 import de.intevation.flys.client.shared.model.DataItem; |
17 import de.intevation.flys.client.shared.model.DefaultData; | 19 import de.intevation.flys.client.shared.model.DefaultData; |
20 import de.intevation.flys.client.shared.model.Recommendation.Facet; | 22 import de.intevation.flys.client.shared.model.Recommendation.Facet; |
21 import de.intevation.flys.client.shared.model.Recommendation.Filter; | 23 import de.intevation.flys.client.shared.model.Recommendation.Filter; |
22 import de.intevation.flys.client.shared.model.ToLoad; | 24 import de.intevation.flys.client.shared.model.ToLoad; |
23 import de.intevation.flys.client.shared.model.User; | 25 import de.intevation.flys.client.shared.model.User; |
24 | 26 |
25 import de.intevation.flys.client.client.Config; | 27 import java.util.List; |
26 import de.intevation.flys.client.client.FLYSConstants; | 28 import java.util.Map; |
27 import de.intevation.flys.client.client.event.StepForwardEvent; | 29 import java.util.Set; |
28 import de.intevation.flys.client.client.services.LoadArtifactService; | |
29 import de.intevation.flys.client.client.services.LoadArtifactServiceAsync; | |
30 | 30 |
31 | 31 |
32 public class WspDatacagePanel extends DatacagePanel { | 32 public class WspDatacagePanel extends DatacagePanel { |
33 | |
34 private static final long serialVersionUID = 2494432743877141135L; | |
33 | 35 |
34 public static final String WATERLEVEL_OUTS = "waterlevels"; | 36 public static final String WATERLEVEL_OUTS = "waterlevels"; |
35 | 37 |
36 public static final FLYSConstants MSG = GWT.create(FLYSConstants.class); | 38 public static final FLYSConstants MSG = GWT.create(FLYSConstants.class); |
37 | 39 |
81 Config config = Config.getInstance(); | 83 Config config = Config.getInstance(); |
82 final String locale = config.getLocale(); | 84 final String locale = config.getLocale(); |
83 final Collection c = this.collection; | 85 final Collection c = this.collection; |
84 final Recommendation r = getSelectedRecommendation(); | 86 final Recommendation r = getSelectedRecommendation(); |
85 | 87 |
88 | |
89 if (r == null) { | |
90 SC.warn(MSG.warning_no_wsp_selected()); | |
91 return; | |
92 } | |
93 | |
86 // 2) Create, load Artifact and fire event | 94 // 2) Create, load Artifact and fire event |
87 loadService.load( | 95 loadService.load( |
88 c, r, "winfo", locale, | 96 c, r, "winfo", locale, |
89 new AsyncCallback<Artifact>() { | 97 new AsyncCallback<Artifact>() { |
98 @Override | |
90 public void onFailure(Throwable caught) { | 99 public void onFailure(Throwable caught) { |
91 SC.warn(caught.getMessage()); | 100 GWT.log("WspDatacagePanel", caught); |
101 SC.warn(FLYS.getExceptionString(MSG, caught)); | |
92 } | 102 } |
93 | 103 |
104 @Override | |
94 public void onSuccess(Artifact artifact) { | 105 public void onSuccess(Artifact artifact) { |
95 fireStepForwardEvent(new StepForwardEvent( | 106 fireStepForwardEvent(new StepForwardEvent( |
96 getData(r, artifact))); | 107 getData(r, artifact))); |
97 } | 108 } |
98 } | 109 } |