annotate flys-client/src/main/java/de/intevation/flys/client/client/ui/wq/QDTable.java @ 1369:1fae113b93fd

Issue 118/203. Lock table for Q input and clear values on input change. Updated i18n strings. flys-client/trunk@3074 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Raimund Renkert <raimund.renkert@intevation.de>
date Tue, 25 Oct 2011 13:32:16 +0000
parents 2c8f1112be37
children 748e7c828d03
rev   line source
580
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.client.client.ui.wq;
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
2
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
3 import com.google.gwt.core.client.GWT;
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
4
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
5 import com.smartgwt.client.types.ListGridFieldType;
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
6 import com.smartgwt.client.types.SelectionStyle;
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
7 import com.smartgwt.client.widgets.grid.ListGrid;
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
8 import com.smartgwt.client.widgets.grid.ListGridField;
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
9
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
10 import de.intevation.flys.client.client.FLYSConstants;
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
11 import de.intevation.flys.client.client.FLYSImages;
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
12
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
13
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
14 /**
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
15 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
16 */
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
17 public class QDTable extends ListGrid {
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
18
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
19 /** The message class that provides i18n strings.*/
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
20 protected FLYSConstants MESSAGE = GWT.create(FLYSConstants.class);
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
21
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
22 /** The interface that provides the image resources. */
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
23 private FLYSImages IMAGES = GWT.create(FLYSImages.class);
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
24
1369
1fae113b93fd Issue 118/203.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 912
diff changeset
25 protected boolean lockClick;
1fae113b93fd Issue 118/203.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 912
diff changeset
26
580
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
27 public QDTable() {
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
28 setWidth100();
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
29 setHeight100();
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
30 setSelectionType(SelectionStyle.SINGLE);
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
31 setSelectionType(SelectionStyle.SINGLE);
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
32 setShowHeaderContextMenu(false);
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
33 setShowRecordComponents(true);
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
34 setShowRecordComponentsByCell(true);
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
35 setEmptyMessage(MESSAGE.empty_table());
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
36
912
2c8f1112be37 Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 904
diff changeset
37 ListGridField addMax = new ListGridField("max", "");
2c8f1112be37 Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 904
diff changeset
38 addMax.setType(ListGridFieldType.ICON);
2c8f1112be37 Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 904
diff changeset
39 addMax.setWidth(30);
2c8f1112be37 Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 904
diff changeset
40 addMax.setCellIcon(IMAGES.markerRed().getURL());
2c8f1112be37 Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 904
diff changeset
41
2c8f1112be37 Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 904
diff changeset
42 ListGridField addMin = new ListGridField("min", "");
2c8f1112be37 Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 904
diff changeset
43 addMin.setType(ListGridFieldType.ICON);
2c8f1112be37 Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 904
diff changeset
44 addMin.setWidth(30);
2c8f1112be37 Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 904
diff changeset
45 addMin.setCellIcon(IMAGES.markerGreen().getURL());
2c8f1112be37 Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 904
diff changeset
46
904
1e08a5b0add9 Changed table header string and set the column width to percental value.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 903
diff changeset
47 ListGridField name = new ListGridField("name", MESSAGE.discharge());
580
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
48 name.setType(ListGridFieldType.TEXT);
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
49 name.setWidth("*");
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
50
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
51 ListGridField type = new ListGridField("type", MESSAGE.type());
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
52 type.setType(ListGridFieldType.TEXT);
904
1e08a5b0add9 Changed table header string and set the column width to percental value.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 903
diff changeset
53 type.setWidth("20%");
580
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
54
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
55 ListGridField value = new ListGridField("value", MESSAGE.wq_value());
903
dd702348b878 Changed columns to the correct type for most tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 894
diff changeset
56 value.setType(ListGridFieldType.FLOAT);
904
1e08a5b0add9 Changed table header string and set the column width to percental value.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 903
diff changeset
57 value.setWidth("20%");
580
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
58
912
2c8f1112be37 Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 904
diff changeset
59 setFields(addMax, addMin, name, type, value);
580
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
60 }
912
2c8f1112be37 Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 904
diff changeset
61
2c8f1112be37 Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 904
diff changeset
62 public void hideIconFields () {
2c8f1112be37 Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 904
diff changeset
63 hideField("max");
2c8f1112be37 Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 904
diff changeset
64 hideField("min");
1369
1fae113b93fd Issue 118/203.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 912
diff changeset
65 lockClick = true;
912
2c8f1112be37 Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 904
diff changeset
66 }
2c8f1112be37 Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 904
diff changeset
67
2c8f1112be37 Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 904
diff changeset
68
2c8f1112be37 Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 904
diff changeset
69 public void showIconFields() {
2c8f1112be37 Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 904
diff changeset
70 showField("max");
2c8f1112be37 Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 904
diff changeset
71 showField("min");
1369
1fae113b93fd Issue 118/203.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 912
diff changeset
72 lockClick = false;
1fae113b93fd Issue 118/203.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 912
diff changeset
73 }
1fae113b93fd Issue 118/203.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 912
diff changeset
74
1fae113b93fd Issue 118/203.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 912
diff changeset
75 public boolean isLocked() {
1fae113b93fd Issue 118/203.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 912
diff changeset
76 return lockClick;
912
2c8f1112be37 Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 904
diff changeset
77 }
2c8f1112be37 Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 904
diff changeset
78
580
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
79 }
42512fce9b1b #140, #122: Splitted the WQD table in the WQInputPanel into two tables: a table for QD values and a table for W values - only the QD table is selectable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
80 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org