Mercurial > dive4elements > river
annotate flys-client/src/main/java/de/intevation/flys/client/client/ui/TableDataPanel.java @ 884:ace7e9cfbb7f
Fixed some bugs that avoided datacage usage.
flys-client/trunk@2718 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 13 Sep 2011 11:31:53 +0000 |
parents | 5a299d49a989 |
children | 39acba4b5f0b |
rev | line source |
---|---|
256
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.client.client.ui; |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
2 |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
3 import java.util.List; |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
4 |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
5 import com.google.gwt.core.client.GWT; |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
6 import com.google.gwt.user.client.rpc.AsyncCallback; |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
7 |
550
605debcbb6a0
Adjusted the return values of the CSVExportService, so that GWT can handle those values better.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
8 import com.smartgwt.client.util.SC; |
256
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
9 import com.smartgwt.client.widgets.Canvas; |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
10 import com.smartgwt.client.widgets.layout.VLayout; |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
11 import com.smartgwt.client.widgets.grid.ListGrid; |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
12 import com.smartgwt.client.widgets.grid.ListGridField; |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
13 import com.smartgwt.client.widgets.grid.ListGridRecord; |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
14 |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
15 import de.intevation.flys.client.shared.model.DataList; |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
16 |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
17 import de.intevation.flys.client.client.FLYSConstants; |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
18 import de.intevation.flys.client.client.Config; |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
19 |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
20 import de.intevation.flys.client.client.services.CSVExportService; |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
21 import de.intevation.flys.client.client.services.CSVExportServiceAsync; |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
22 |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
23 /** |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
24 * This UIProvider creates a widget that displays calculated data in a table. |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
25 * |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
26 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
27 */ |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
28 public class TableDataPanel |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
29 { |
810
a443dd6566b8
Minor cosmetic changes (javadoc comments).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
788
diff
changeset
|
30 /** The message class that provides i18n strings. */ |
256
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
31 protected FLYSConstants MESSAGES = GWT.create(FLYSConstants.class); |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
32 |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
33 protected CSVExportServiceAsync exportService = |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
34 GWT.create(CSVExportService.class); |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
35 |
810
a443dd6566b8
Minor cosmetic changes (javadoc comments).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
788
diff
changeset
|
36 /** A container that will contain the location or the distance panel. */ |
256
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
37 protected VLayout container; |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
38 |
810
a443dd6566b8
Minor cosmetic changes (javadoc comments).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
788
diff
changeset
|
39 /** The export type. */ |
256
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
40 protected String name; |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
41 |
810
a443dd6566b8
Minor cosmetic changes (javadoc comments).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
788
diff
changeset
|
42 /** The UUID of the collection. */ |
256
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
43 protected String uuid; |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
44 |
810
a443dd6566b8
Minor cosmetic changes (javadoc comments).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
788
diff
changeset
|
45 /** The table. */ |
256
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
46 protected ListGrid dataTable; |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
47 |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
48 |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
49 /** |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
50 * Creates a new LocationDistancePanel instance. |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
51 */ |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
52 public TableDataPanel() { |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
53 container = new VLayout(); |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
54 dataTable = new ListGrid(); |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
55 name = ""; |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
56 } |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
57 |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
58 |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
59 /** |
810
a443dd6566b8
Minor cosmetic changes (javadoc comments).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
788
diff
changeset
|
60 * This method creates a widget that contains a table. |
256
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
61 * |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
62 * @return a panel. |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
63 */ |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
64 public Canvas create() { |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
65 Config config = Config.getInstance(); |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
66 String url = config.getServerUrl(); |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
67 String locale = config.getLocale (); |
263
f56523bf4c55
Changed the empty table message for helper and data tables.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
259
diff
changeset
|
68 dataTable.setEmptyMessage(MESSAGES.empty_table()); |
284
be842e36ce1c
ISSUE 46: Removed the table header context menu.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
263
diff
changeset
|
69 dataTable.setShowHeaderContextMenu(false); |
879
5a299d49a989
Set the data table cells selectable for copy&paste.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
810
diff
changeset
|
70 dataTable.setCanDragSelectText(true); |
256
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
71 |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
72 exportService.getCSV(url, locale, uuid, name, |
550
605debcbb6a0
Adjusted the return values of the CSVExportService, so that GWT can handle those values better.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
73 new AsyncCallback<List<String[]>>() { |
256
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
74 public void onFailure(Throwable caught) { |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
75 GWT.log("Could not recieve csv."); |
550
605debcbb6a0
Adjusted the return values of the CSVExportService, so that GWT can handle those values better.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
76 SC.warn(caught.getMessage()); |
256
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
77 } |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
78 |
550
605debcbb6a0
Adjusted the return values of the CSVExportService, so that GWT can handle those values better.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
284
diff
changeset
|
79 public void onSuccess(List<String[]> l) { |
256
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
80 GWT.log("Recieved csv with " + l.size() + " lines."); |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
81 setData(l); |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
82 } |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
83 } |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
84 ); |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
85 |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
86 container.addMember(dataTable); |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
87 |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
88 return container; |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
89 } |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
90 |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
91 |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
92 public void setName(String name) { |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
93 this.name = name; |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
94 } |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
95 |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
96 public void setUuid(String uuid) { |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
97 this.uuid = uuid; |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
98 } |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
99 |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
100 |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
101 public Canvas createOld(DataList dataList) { |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
102 return null; |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
103 } |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
104 |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
105 |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
106 protected Canvas createWidget(DataList data) { |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
107 return null; |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
108 } |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
109 |
259
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
110 |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
111 /** |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
112 * This method sets the data to a dynmic table. |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
113 * |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
114 * @param list List if String[] containing the data. |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
115 */ |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
116 public void setData(List list) { |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
117 String[] header = (String[])list.get(0); |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
118 ListGridField[] fields = new ListGridField[header.length]; |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
119 for(int i = 0; i < header.length; i++) { |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
120 ListGridField f = new ListGridField(String.valueOf(i)); |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
121 fields[i] = f; |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
122 f.setTitle(header[i]); |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
123 } |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
124 |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
125 if (header.length == 2) { |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
126 dataTable.setFields(fields[0], fields[1]); |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
127 } |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
128 else if(header.length == 3) { |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
129 dataTable.setFields(fields[0], fields[1], fields[2]); |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
130 } |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
131 else if(header.length == 4) { |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
132 dataTable.setFields(fields[0], fields[1], fields[2], fields[3]); |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
133 } |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
134 else if(header.length == 5) { |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
135 dataTable.setFields( |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
136 fields[0], |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
137 fields[1], |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
138 fields[2], |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
139 fields[3], |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
140 fields[4]); |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
141 } |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
142 |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
143 for(int i = 1; i < list.size(); i++) { |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
144 String[] sItem = (String[])list.get(i); |
256
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
145 ListGridRecord r = new ListGridRecord(); |
259
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
146 for(int j = 0; j < sItem.length; j++) { |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
147 r.setAttribute(String.valueOf(j), sItem[j]); |
256
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
148 } |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
149 dataTable.addData(r); |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
150 } |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
151 } |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
152 } |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
153 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |