Mercurial > dive4elements > river
annotate flys-client/src/main/java/de/intevation/flys/client/client/ui/TableDataPanel.java @ 262:44a340c9becc
Added stub for meta data service.
flys-client/trunk@1881 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Tue, 10 May 2011 13:44:57 +0000 |
parents | 50a95db68e66 |
children | f56523bf4c55 |
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 |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
8 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
|
9 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
|
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 { |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
30 /** 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
|
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 /** 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
|
34 protected CSVExportServiceAsync exportService = |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
35 GWT.create(CSVExportService.class); |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
36 |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
37 /** 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
|
38 protected VLayout container; |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
39 |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
40 /** The export type.*/ |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
41 protected String name; |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
42 |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
43 /** The UUID of the collection */ |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
44 protected String uuid; |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
45 |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
46 /** The table*/ |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
47 protected ListGrid dataTable; |
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 /** |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
51 * Creates a new LocationDistancePanel instance. |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
52 */ |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
53 public TableDataPanel() { |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
54 container = new VLayout(); |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
55 dataTable = new ListGrid(); |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
56 name = ""; |
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 |
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 * 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
|
62 * |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
63 * @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
|
64 * |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
65 * @return a panel. |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
66 */ |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
67 public Canvas create() { |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
68 Config config = Config.getInstance(); |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
69 String url = config.getServerUrl(); |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
70 String locale = config.getLocale (); |
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, |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
73 new AsyncCallback<List>() { |
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."); |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
76 GWT.log(caught.getMessage()); |
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 |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
79 public void onSuccess(List l) { |
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 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
|
87 l.setHeight(20); |
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 container.addMember(l); |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
90 container.addMember(dataTable); |
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 return container; |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
93 } |
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 setName(String name) { |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
97 this.name = name; |
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 public void setUuid(String uuid) { |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
101 this.uuid = uuid; |
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 |
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 public Canvas createOld(DataList dataList) { |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
106 return null; |
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 |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
109 |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
110 protected Canvas createWidget(DataList data) { |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
111 return null; |
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 |
259
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
114 |
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 * 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
|
117 * |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
118 * @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
|
119 */ |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
120 public void setData(List list) { |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
121 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
|
122 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
|
123 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
|
124 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
|
125 fields[i] = f; |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
126 f.setTitle(header[i]); |
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 |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
129 if (header.length == 2) { |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
130 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
|
131 } |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
132 else if(header.length == 3) { |
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], fields[2]); |
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 == 4) { |
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], fields[3]); |
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 == 5) { |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
139 dataTable.setFields( |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
140 fields[0], |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
141 fields[1], |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
142 fields[2], |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
143 fields[3], |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
144 fields[4]); |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
145 } |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
146 |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
147 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
|
148 GWT.log ("items" + list.size()); |
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
149 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
|
150 ListGridRecord r = new ListGridRecord(); |
259
50a95db68e66
Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
256
diff
changeset
|
151 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
|
152 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
|
153 } |
5e1c1b7d6516
Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
154 dataTable.addData(r); |
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 } |
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 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |