Mercurial > dive4elements > river
annotate flys-client/src/main/java/de/intevation/flys/client/client/ui/wq/QDTable.java @ 1309:a95e82d6bcc1
Refactored the code to create a context menu and a style editor so that it is also available for maps.
flys-client/trunk@2943 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 12 Oct 2011 08:53:17 +0000 |
parents | 2c8f1112be37 |
children | 1fae113b93fd |
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 |
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
|
25 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
|
26 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
|
27 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
|
28 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
|
29 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
|
30 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
|
31 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
|
32 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
|
33 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
|
34 |
912
2c8f1112be37
Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
904
diff
changeset
|
35 ListGridField addMax = new ListGridField("max", ""); |
2c8f1112be37
Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
904
diff
changeset
|
36 addMax.setType(ListGridFieldType.ICON); |
2c8f1112be37
Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
904
diff
changeset
|
37 addMax.setWidth(30); |
2c8f1112be37
Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
904
diff
changeset
|
38 addMax.setCellIcon(IMAGES.markerRed().getURL()); |
2c8f1112be37
Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
904
diff
changeset
|
39 |
2c8f1112be37
Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
904
diff
changeset
|
40 ListGridField addMin = new ListGridField("min", ""); |
2c8f1112be37
Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
904
diff
changeset
|
41 addMin.setType(ListGridFieldType.ICON); |
2c8f1112be37
Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
904
diff
changeset
|
42 addMin.setWidth(30); |
2c8f1112be37
Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
904
diff
changeset
|
43 addMin.setCellIcon(IMAGES.markerGreen().getURL()); |
2c8f1112be37
Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
904
diff
changeset
|
44 |
904
1e08a5b0add9
Changed table header string and set the column width to percental value.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
903
diff
changeset
|
45 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
|
46 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
|
47 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
|
48 |
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 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
|
50 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
|
51 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
|
52 |
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
|
53 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
|
54 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
|
55 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
|
56 |
912
2c8f1112be37
Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
904
diff
changeset
|
57 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
|
58 } |
912
2c8f1112be37
Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
904
diff
changeset
|
59 |
2c8f1112be37
Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
904
diff
changeset
|
60 public void hideIconFields () { |
2c8f1112be37
Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
904
diff
changeset
|
61 hideField("max"); |
2c8f1112be37
Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
904
diff
changeset
|
62 hideField("min"); |
2c8f1112be37
Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
904
diff
changeset
|
63 } |
2c8f1112be37
Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
904
diff
changeset
|
64 |
2c8f1112be37
Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
904
diff
changeset
|
65 |
2c8f1112be37
Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
904
diff
changeset
|
66 public void showIconFields() { |
2c8f1112be37
Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
904
diff
changeset
|
67 showField("max"); |
2c8f1112be37
Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
904
diff
changeset
|
68 showField("min"); |
2c8f1112be37
Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
904
diff
changeset
|
69 } |
2c8f1112be37
Rollback for input assistance of "Q/D" table.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
904
diff
changeset
|
70 |
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
|
71 } |
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
|
72 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |