8854
|
1 /** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde |
|
2 * Software engineering by |
|
3 * Björnsen Beratende Ingenieure GmbH |
|
4 * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt |
|
5 * |
|
6 * This file is Free Software under the GNU AGPL (>=v3) |
|
7 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
|
8 * documentation coming with Dive4Elements River for details. |
|
9 */ |
|
10 package org.dive4elements.river.client.client.ui.sinfo; |
|
11 |
|
12 import java.util.ArrayList; |
|
13 import java.util.List; |
|
14 |
|
15 import org.dive4elements.river.client.client.FLYSConstants; |
|
16 import org.dive4elements.river.client.client.ui.AbstractPairRecommendationPanel.IValidator; |
|
17 |
|
18 import com.smartgwt.client.widgets.grid.ListGrid; |
|
19 import com.smartgwt.client.widgets.grid.ListGridRecord; |
|
20 |
|
21 /** |
|
22 * Contains the old code from the validate-method of the DatacageTwinPanel. |
|
23 * |
|
24 * @author Gernot Belger |
|
25 */ |
|
26 final class FlowDepthTwinPanelValidator implements IValidator { |
|
27 |
|
28 @Override |
|
29 public List<String> validate(final ListGrid differencesList, final FLYSConstants msgProvider) { |
|
30 |
|
31 final List<String> errors = new ArrayList<String>(); |
|
32 if (differencesList.getRecords().length == 0) { |
|
33 // FIXME: waterlevel dependent! This will lead to a bad error message in English, for M-Info/Bed-Differences calculation |
|
34 errors.add(msgProvider.sinfo_flowdepth_twinpanel_no_pair_selected()); |
|
35 } |
|
36 |
|
37 return errors; |
|
38 } |
|
39 } |