annotate flys-client/src/main/java/de/intevation/flys/client/client/ui/TableDataPanel.java @ 550:605debcbb6a0

Adjusted the return values of the CSVExportService, so that GWT can handle those values better. flys-client/trunk@2063 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 07 Jun 2011 12:51:57 +0000
parents be842e36ce1c
children dfbc6693247e
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.Label;
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.layout.VLayout;
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.ListGrid;
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.ListGridField;
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
14 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
15
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
16 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
17
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.FLYSConstants;
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
19 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
20
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.CSVExportService;
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
22 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
23
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
24 /**
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
25 * 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
26 *
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
27 * @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
28 */
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
29 public class TableDataPanel
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
30 {
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
31 /** The message class that provides i18n strings.*/
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
32 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
33
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
34 /** The DistanceInfoService used to retrieve locations about rivers.*/
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
35 protected CSVExportServiceAsync exportService =
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
36 GWT.create(CSVExportService.class);
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
37
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
38 /** A container that will contain the location or the distance panel.*/
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
39 protected VLayout container;
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
40
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
41 /** The export type.*/
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
42 protected String name;
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
43
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
44 /** The UUID of the collection */
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
45 protected String uuid;
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
46
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
47 /** The table*/
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
48 protected ListGrid dataTable;
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
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 * Creates a new LocationDistancePanel instance.
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
53 */
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
54 public TableDataPanel() {
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
55 container = new VLayout();
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
56 dataTable = new ListGrid();
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
57 name = "";
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
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
60
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 * This method creates a widget that contains a table
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 * @param data The data that might be inserted.//Use this?
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
65 *
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
66 * @return a panel.
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
67 */
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
68 public Canvas create() {
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
69 Config config = Config.getInstance();
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
70 String url = config.getServerUrl();
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
71 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
72 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
73 dataTable.setShowHeaderContextMenu(false);
256
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
74
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
75 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
76 new AsyncCallback<List<String[]>>() {
256
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
77 public void onFailure(Throwable caught) {
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
78 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
79 SC.warn(caught.getMessage());
256
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
80 }
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
81
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
82 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
83 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
84 setData(l);
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 }
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
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
89 Label l = new Label (MESSAGES.calcTableTitle());
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
90 l.setHeight(20);
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 container.addMember(l);
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
93 container.addMember(dataTable);
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 return container;
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
96 }
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
97
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 public void setName(String name) {
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
100 this.name = name;
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
101 }
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
102
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
103 public void setUuid(String uuid) {
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
104 this.uuid = uuid;
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
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
107
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
108 public Canvas createOld(DataList dataList) {
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
109 return null;
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
110 }
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
111
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
112
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
113 protected Canvas createWidget(DataList data) {
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
114 return null;
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
115 }
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
116
259
50a95db68e66 Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 256
diff changeset
117
50a95db68e66 Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 256
diff changeset
118 /**
50a95db68e66 Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 256
diff changeset
119 * 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
120 *
50a95db68e66 Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 256
diff changeset
121 * @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
122 */
50a95db68e66 Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 256
diff changeset
123 public void setData(List list) {
50a95db68e66 Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 256
diff changeset
124 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
125 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
126 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
127 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
128 fields[i] = f;
50a95db68e66 Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 256
diff changeset
129 f.setTitle(header[i]);
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
50a95db68e66 Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 256
diff changeset
132 if (header.length == 2) {
50a95db68e66 Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 256
diff changeset
133 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
134 }
50a95db68e66 Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 256
diff changeset
135 else if(header.length == 3) {
50a95db68e66 Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 256
diff changeset
136 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
137 }
50a95db68e66 Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 256
diff changeset
138 else if(header.length == 4) {
50a95db68e66 Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 256
diff changeset
139 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
140 }
50a95db68e66 Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 256
diff changeset
141 else if(header.length == 5) {
50a95db68e66 Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 256
diff changeset
142 dataTable.setFields(
50a95db68e66 Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 256
diff changeset
143 fields[0],
50a95db68e66 Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 256
diff changeset
144 fields[1],
50a95db68e66 Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 256
diff changeset
145 fields[2],
50a95db68e66 Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 256
diff changeset
146 fields[3],
50a95db68e66 Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 256
diff changeset
147 fields[4]);
50a95db68e66 Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 256
diff changeset
148 }
50a95db68e66 Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 256
diff changeset
149
50a95db68e66 Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 256
diff changeset
150 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
151 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
152 ListGridRecord r = new ListGridRecord();
259
50a95db68e66 Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 256
diff changeset
153 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
154 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
155 }
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
156 dataTable.addData(r);
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
157 }
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
158 }
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
159 }
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
160 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org