annotate gwt-client/src/main/java/org/dive4elements/river/client/client/ui/uinfo/InundationWMSInputPanel.java @ 9481:787fc085459b

TSV introduced; uinfo.inundationWMS-Config
author gernotbelger
date Wed, 12 Sep 2018 10:55:09 +0200
parents
children ba0561906f81
rev   line source
9481
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
2 * Software engineering by Intevation GmbH
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
3 *
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
4 * This file is Free Software under the GNU AGPL (>=v3)
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
6 * documentation coming with Dive4Elements River for details.
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
7 */
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
8
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
9 package org.dive4elements.river.client.client.ui.uinfo;
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
10
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
11 import org.dive4elements.river.client.client.FLYSConstants;
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
12 import org.dive4elements.river.client.client.ui.AbstractSingleItemPanel;
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
13 import org.dive4elements.river.client.shared.model.DataList;
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
14
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
15 import com.smartgwt.client.widgets.Canvas;
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
16 import com.smartgwt.client.widgets.Label;
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
17 import com.smartgwt.client.widgets.form.DynamicForm;
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
18 import com.smartgwt.client.widgets.form.fields.TextItem;
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
19 import com.smartgwt.client.widgets.layout.VLayout;
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
20
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
21 public class InundationWMSInputPanel extends AbstractSingleItemPanel {
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
22
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
23 private static final long serialVersionUID = 1L;
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
24 private final boolean isEditable;
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
25
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
26 public InundationWMSInputPanel(final FLYSConstants msg, final String titleForCreateOld, final boolean isEditable) {
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
27 super(new UinfoInundationSingleYearEpochBehaviour(msg, titleForCreateOld));
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
28 this.isEditable = isEditable;
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
29 }
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
30
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
31 @Override
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
32 protected String getDatakey() {
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
33 return "year_epoch_select";
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
34 }
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
35
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
36 @Override
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
37 protected String errorForItemMsg() {
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
38 return this.MSG.no_data_for_input();
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
39 }
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
40
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
41 @Override
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
42 public Canvas createWidget(final DataList data) {
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
43 final VLayout layout = new VLayout();
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
44
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
45 final Label title = new Label(data.get(0).getDescription());
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
46 title.setHeight("25px");
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
47
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
48 final DynamicForm form = new DynamicForm();
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
49 form.setNumCols(4);
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
50
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
51 final TextItem inputItem = createInputItem("INPUT");
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
52 inputItem.setWidth(250);
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
53 inputItem.setCanEdit(this.isEditable);
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
54 inputItem.setShowTitle(false);
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
55 form.setFields(inputItem);
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
56
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
57 layout.addMember(title);
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
58 layout.addMember(form);
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
59
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
60 return layout;
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
61 }
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
62
787fc085459b TSV introduced; uinfo.inundationWMS-Config
gernotbelger
parents:
diff changeset
63 }

http://dive4elements.wald.intevation.org