9066
|
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 |
9078
|
11 import org.dive4elements.river.client.client.ui.AbstractSingleItemPanel; |
9066
|
12 import org.dive4elements.river.client.shared.model.DataList; |
|
13 |
|
14 import com.smartgwt.client.widgets.Canvas; |
|
15 import com.smartgwt.client.widgets.form.DynamicForm; |
|
16 import com.smartgwt.client.widgets.form.fields.StaticTextItem; |
|
17 import com.smartgwt.client.widgets.layout.VLayout; |
|
18 |
9078
|
19 public class LoadSedimentHeightPanel extends AbstractSingleItemPanel { |
9066
|
20 private static final long serialVersionUID = 1L; |
|
21 |
|
22 public LoadSedimentHeightPanel() { |
|
23 } |
|
24 |
|
25 @Override |
9078
|
26 protected String getDatakey() { |
|
27 return "sedimentheight"; |
|
28 } |
9066
|
29 |
9078
|
30 @Override |
|
31 protected boolean getTitleVisible() { |
|
32 return false; |
|
33 } |
9066
|
34 |
9078
|
35 @Override |
|
36 protected String errorForItemMsg() { |
|
37 return this.MSG.no_data_sediment_difference(); |
|
38 } |
9066
|
39 |
9078
|
40 @Override |
|
41 public Canvas createWidget(final DataList data) { |
|
42 final VLayout layout = (VLayout) super.createWidget(data); |
9066
|
43 |
9078
|
44 // |
|
45 // final Label title = new Label(data.get(0).getDescription()); |
|
46 // title.setHeight("35px"); |
|
47 // |
|
48 // sorgt dafür, dass HINTER dem Eingabefeld noch ein Textfeld erscheint |
|
49 final DynamicForm form = (DynamicForm) layout.getMember(FORM_ID); |
|
50 final StaticTextItem textItem = new StaticTextItem("IRRELEVANT_NAME"); |
|
51 textItem.setValue("cm"); |
|
52 textItem.setShowTitle(false); |
|
53 |
|
54 form.setFields(this.inputItem, textItem); |
9066
|
55 |
|
56 return layout; |
|
57 } |
|
58 |
|
59 @Override |
9078
|
60 protected void appendValue(final String value) { // SINGLE-Input: COPY -> TODO: helper |
|
61 this.inputItem.setValue(value); |
9066
|
62 } |
|
63 |
|
64 } |