Mercurial > dive4elements > river
annotate gwt-client/src/main/java/org/dive4elements/river/client/client/ui/uinfo/InundationWMSInputPanel.java @ 9559:ba0561906f81
Uinfo inundation duration workflow (vegetation zones, scenario), wms-config changed
author | gernotbelger |
---|---|
date | Wed, 24 Oct 2018 18:40:38 +0200 |
parents | 787fc085459b |
children |
rev | line source |
---|---|
9481 | 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.uinfo; | |
10 | |
11 import org.dive4elements.river.client.client.FLYSConstants; | |
12 import org.dive4elements.river.client.client.ui.AbstractSingleItemPanel; | |
13 import org.dive4elements.river.client.shared.model.DataList; | |
14 | |
15 import com.smartgwt.client.widgets.Canvas; | |
16 import com.smartgwt.client.widgets.Label; | |
17 import com.smartgwt.client.widgets.form.DynamicForm; | |
9559
ba0561906f81
Uinfo inundation duration workflow (vegetation zones, scenario), wms-config changed
gernotbelger
parents:
9481
diff
changeset
|
18 import com.smartgwt.client.widgets.form.fields.StaticTextItem; |
9481 | 19 import com.smartgwt.client.widgets.form.fields.TextItem; |
20 import com.smartgwt.client.widgets.layout.VLayout; | |
21 | |
22 public class InundationWMSInputPanel extends AbstractSingleItemPanel { | |
23 | |
24 private static final long serialVersionUID = 1L; | |
25 private final boolean isEditable; | |
9559
ba0561906f81
Uinfo inundation duration workflow (vegetation zones, scenario), wms-config changed
gernotbelger
parents:
9481
diff
changeset
|
26 private final String dataKey; |
ba0561906f81
Uinfo inundation duration workflow (vegetation zones, scenario), wms-config changed
gernotbelger
parents:
9481
diff
changeset
|
27 private final String appendString; |
9481 | 28 |
9559
ba0561906f81
Uinfo inundation duration workflow (vegetation zones, scenario), wms-config changed
gernotbelger
parents:
9481
diff
changeset
|
29 public InundationWMSInputPanel(final FLYSConstants msg, final String dataKey, final String titleForCreateOld, final String appendString, |
ba0561906f81
Uinfo inundation duration workflow (vegetation zones, scenario), wms-config changed
gernotbelger
parents:
9481
diff
changeset
|
30 final boolean isEditable) { |
ba0561906f81
Uinfo inundation duration workflow (vegetation zones, scenario), wms-config changed
gernotbelger
parents:
9481
diff
changeset
|
31 super(new UinfoInundationSingleYearEpochBehaviour(appendString, msg, titleForCreateOld)); |
9481 | 32 this.isEditable = isEditable; |
9559
ba0561906f81
Uinfo inundation duration workflow (vegetation zones, scenario), wms-config changed
gernotbelger
parents:
9481
diff
changeset
|
33 this.dataKey = dataKey; |
ba0561906f81
Uinfo inundation duration workflow (vegetation zones, scenario), wms-config changed
gernotbelger
parents:
9481
diff
changeset
|
34 this.appendString = appendString; |
9481 | 35 } |
36 | |
37 @Override | |
38 protected String getDatakey() { | |
9559
ba0561906f81
Uinfo inundation duration workflow (vegetation zones, scenario), wms-config changed
gernotbelger
parents:
9481
diff
changeset
|
39 return this.dataKey; |
9481 | 40 } |
41 | |
42 @Override | |
43 protected String errorForItemMsg() { | |
44 return this.MSG.no_data_for_input(); | |
45 } | |
46 | |
47 @Override | |
48 public Canvas createWidget(final DataList data) { | |
49 final VLayout layout = new VLayout(); | |
50 | |
51 final Label title = new Label(data.get(0).getDescription()); | |
52 title.setHeight("25px"); | |
53 | |
54 final DynamicForm form = new DynamicForm(); | |
55 form.setNumCols(4); | |
56 | |
57 final TextItem inputItem = createInputItem("INPUT"); | |
58 inputItem.setWidth(250); | |
59 inputItem.setCanEdit(this.isEditable); | |
9559
ba0561906f81
Uinfo inundation duration workflow (vegetation zones, scenario), wms-config changed
gernotbelger
parents:
9481
diff
changeset
|
60 |
9481 | 61 inputItem.setShowTitle(false); |
9559
ba0561906f81
Uinfo inundation duration workflow (vegetation zones, scenario), wms-config changed
gernotbelger
parents:
9481
diff
changeset
|
62 |
ba0561906f81
Uinfo inundation duration workflow (vegetation zones, scenario), wms-config changed
gernotbelger
parents:
9481
diff
changeset
|
63 if (this.appendString != null) { |
ba0561906f81
Uinfo inundation duration workflow (vegetation zones, scenario), wms-config changed
gernotbelger
parents:
9481
diff
changeset
|
64 |
ba0561906f81
Uinfo inundation duration workflow (vegetation zones, scenario), wms-config changed
gernotbelger
parents:
9481
diff
changeset
|
65 final StaticTextItem fromText = new StaticTextItem("staticAppend"); |
ba0561906f81
Uinfo inundation duration workflow (vegetation zones, scenario), wms-config changed
gernotbelger
parents:
9481
diff
changeset
|
66 fromText.setValue(this.appendString); |
ba0561906f81
Uinfo inundation duration workflow (vegetation zones, scenario), wms-config changed
gernotbelger
parents:
9481
diff
changeset
|
67 fromText.setShowTitle(false); |
ba0561906f81
Uinfo inundation duration workflow (vegetation zones, scenario), wms-config changed
gernotbelger
parents:
9481
diff
changeset
|
68 form.setFields(inputItem, fromText); |
ba0561906f81
Uinfo inundation duration workflow (vegetation zones, scenario), wms-config changed
gernotbelger
parents:
9481
diff
changeset
|
69 } else { |
ba0561906f81
Uinfo inundation duration workflow (vegetation zones, scenario), wms-config changed
gernotbelger
parents:
9481
diff
changeset
|
70 form.setFields(inputItem); |
ba0561906f81
Uinfo inundation duration workflow (vegetation zones, scenario), wms-config changed
gernotbelger
parents:
9481
diff
changeset
|
71 } |
9481 | 72 |
73 layout.addMember(title); | |
74 layout.addMember(form); | |
75 | |
76 return layout; | |
77 } | |
78 | |
79 } |