Mercurial > dive4elements > river
comparison gwt-client/src/main/java/org/dive4elements/river/client/client/ui/bundu/BunduWstCalcSelectRadioPanel.java @ 9292:e6958f0e72fa
bundu.bezugswst details
author | gernotbelger |
---|---|
date | Tue, 24 Jul 2018 15:30:10 +0200 |
parents | |
children | 1a4d2ce77423 |
comparison
equal
deleted
inserted
replaced
9291:913bc7d1d2a8 | 9292:e6958f0e72fa |
---|---|
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde | |
2 * Software engineering by Intevation GmbH | |
3 * | |
4 * This file is Free Software under the GNU AGPL (>=v3) | |
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the | |
6 * documentation coming with Dive4Elements River for details. | |
7 */ | |
8 | |
9 package org.dive4elements.river.client.client.ui.bundu; | |
10 | |
11 import org.dive4elements.river.client.client.ui.RadioPanel; | |
12 import org.dive4elements.river.client.shared.model.Data; | |
13 import org.dive4elements.river.client.shared.model.DataItem; | |
14 import org.dive4elements.river.client.shared.model.DefaultData; | |
15 import org.dive4elements.river.client.shared.model.DefaultDataItem; | |
16 | |
17 public class BunduWstCalcSelectRadioPanel extends RadioPanel { | |
18 | |
19 private static final long serialVersionUID = 3357071563224461043L; | |
20 | |
21 @Override | |
22 protected Data[] getData() { | |
23 // if auto selected, additional custom data (function) has to be set. the rest is standard radioPanel behaviour | |
24 final String value = this.form.getValueAsString("selection"); | |
25 | |
26 final DataItem item = new DefaultDataItem("label_irrelevant", "description_irrelevant", value); | |
27 final DefaultData selection = new DefaultData(this.dataName, "label_no_effect", "description_no_effect", new DataItem[] { item }); | |
28 if (value.equals("state.bundu.calc.auto")) { | |
29 final Data[] data = new Data[2]; | |
30 data[0] = selection; | |
31 data[1] = new DefaultData("function", "label_no_effect", "description_no_effect", | |
32 new DataItem[] { new DefaultDataItem("", "", org.dive4elements.river.client.client.ui.fixation.FixFunctionSelect.funcDesc.get("log")) }); | |
33 return data; | |
34 } else { | |
35 return new Data[] { selection }; | |
36 } | |
37 } | |
38 | |
39 } |