Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacagePairWidget.java @ 4567:5e6e89f19a37
flys/client: Exception catched and replaced by friendly warning (MINFO Sohlhoehendifferenz) #967/flys.
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Sun, 18 Nov 2012 01:19:07 +0100 |
parents | 1755a1bfe5ce |
children |
comparison
equal
deleted
inserted
replaced
4566:1784ef23e29e | 4567:5e6e89f19a37 |
---|---|
1 package de.intevation.flys.client.client.ui; | 1 package de.intevation.flys.client.client.ui; |
2 | 2 |
3 import com.google.gwt.core.client.GWT; | 3 import com.google.gwt.core.client.GWT; |
4 | 4 |
5 import com.smartgwt.client.util.SC; | |
5 import com.smartgwt.client.widgets.Button; | 6 import com.smartgwt.client.widgets.Button; |
6 | 7 import com.smartgwt.client.widgets.events.ClickEvent; |
8 import com.smartgwt.client.widgets.events.ClickHandler; | |
9 import com.smartgwt.client.widgets.grid.ListGrid; | |
10 import com.smartgwt.client.widgets.layout.HLayout; | |
7 import com.smartgwt.client.widgets.layout.VLayout; | 11 import com.smartgwt.client.widgets.layout.VLayout; |
8 import com.smartgwt.client.widgets.layout.HLayout; | |
9 | |
10 import com.smartgwt.client.widgets.events.ClickHandler; | |
11 import com.smartgwt.client.widgets.events.ClickEvent; | |
12 | |
13 import com.smartgwt.client.widgets.grid.ListGrid; | |
14 | |
15 import de.intevation.flys.client.shared.model.Artifact; | |
16 import de.intevation.flys.client.shared.model.User; | |
17 import de.intevation.flys.client.shared.model.ToLoad; | |
18 | 12 |
19 import de.intevation.flys.client.client.FLYSConstants; | 13 import de.intevation.flys.client.client.FLYSConstants; |
14 import de.intevation.flys.client.shared.model.Artifact; | |
15 import de.intevation.flys.client.shared.model.ToLoad; | |
16 import de.intevation.flys.client.shared.model.User; | |
20 | 17 |
21 | 18 |
22 /** | 19 /** |
23 * Widget showing two Datacages and a add-this-button. | 20 * Widget showing two Datacages and a add-this-button. |
24 * Insert a record into a listgrid when add-this-button clicked. | 21 * Insert a record into a listgrid when add-this-button clicked. |
93 */ | 90 */ |
94 public void plusClicked() { | 91 public void plusClicked() { |
95 ToLoad toLoad1 = firstDatacageWidget.getSelection(); | 92 ToLoad toLoad1 = firstDatacageWidget.getSelection(); |
96 ToLoad toLoad2 = secondDatacageWidget.getSelection(); | 93 ToLoad toLoad2 = secondDatacageWidget.getSelection(); |
97 | 94 |
98 // TODO further sanitize (toRecommendations.length) | 95 if (toLoad1 == null || toLoad2 == null || |
99 if (toLoad1 == null || toLoad2 == null) { | 96 toLoad1.toRecommendations().isEmpty() || |
97 toLoad2.toRecommendations().isEmpty()) { | |
98 SC.say(MSG.warning_select_two_values()); | |
100 return; | 99 return; |
101 } | 100 } |
102 | 101 |
103 grid.addData(new RecommendationPairRecord( | 102 grid.addData(new RecommendationPairRecord( |
104 toLoad1.toRecommendations().get(0), | 103 toLoad1.toRecommendations().get(0), |