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; |
9079
|
15 import com.smartgwt.client.widgets.Label; |
9066
|
16 import com.smartgwt.client.widgets.form.DynamicForm; |
|
17 import com.smartgwt.client.widgets.form.fields.StaticTextItem; |
9079
|
18 import com.smartgwt.client.widgets.form.fields.TextItem; |
9066
|
19 import com.smartgwt.client.widgets.layout.VLayout; |
|
20 |
9078
|
21 public class LoadSedimentHeightPanel extends AbstractSingleItemPanel { |
9066
|
22 private static final long serialVersionUID = 1L; |
|
23 |
|
24 public LoadSedimentHeightPanel() { |
9079
|
25 super(Type.single); |
9066
|
26 } |
|
27 |
|
28 @Override |
9078
|
29 protected String getDatakey() { |
|
30 return "sedimentheight"; |
|
31 } |
9066
|
32 |
9078
|
33 @Override |
|
34 protected String errorForItemMsg() { |
|
35 return this.MSG.no_data_sediment_difference(); |
|
36 } |
9066
|
37 |
9078
|
38 @Override |
|
39 public Canvas createWidget(final DataList data) { |
9079
|
40 final VLayout layout = new VLayout(); |
9066
|
41 |
9079
|
42 final Label title = new Label(data.get(0).getDescription()); |
|
43 title.setHeight("25px"); |
|
44 |
|
45 final DynamicForm form = new DynamicForm(); |
|
46 form.setNumCols(4); |
|
47 final TextItem inputItem = createInputItem(""); |
9078
|
48 final StaticTextItem textItem = new StaticTextItem("IRRELEVANT_NAME"); |
9079
|
49 |
9078
|
50 textItem.setValue("cm"); |
|
51 textItem.setShowTitle(false); |
9079
|
52 form.setFields(inputItem, textItem); |
9078
|
53 |
9079
|
54 layout.addMember(title); |
|
55 layout.addMember(form); |
9066
|
56 |
|
57 return layout; |
|
58 } |
9079
|
59 } |