Mercurial > hg > STI-GWT
comparison src/econnect/wp3_3/client/core/ApplicationGrid.java @ 86:ed444173aef0 trimmed_data
local CSV loading
author | Sebastian Kruse <skruse@mpiwg-berlin.mpg.de> |
---|---|
date | Thu, 07 Mar 2013 14:47:36 +0100 |
parents | 050331208ad7 |
children | 0327cffe65ec |
comparison
equal
deleted
inserted
replaced
85:108c853e0900 | 86:ed444173aef0 |
---|---|
180 final ArrayList<ArrayList<int[]>> entries = new ArrayList<ArrayList<int[]>>(); | 180 final ArrayList<ArrayList<int[]>> entries = new ArrayList<ArrayList<int[]>>(); |
181 final FileUpload uploadKML = new FileUpload(); | 181 final FileUpload uploadKML = new FileUpload(); |
182 //skruse: The element will be accessed by its ID in the JS code | 182 //skruse: The element will be accessed by its ID in the JS code |
183 //either don't change this name, or change it also in STICore.js | 183 //either don't change this name, or change it also in STICore.js |
184 uploadKML.getElement().setId("localKMLFileChooser"); | 184 uploadKML.getElement().setId("localKMLFileChooser"); |
185 final FileUpload uploadCSV = new FileUpload(); | |
186 //skruse: The element will be accessed by its ID in the JS code | |
187 //either don't change this name, or change it also in STICore.js | |
188 uploadCSV.getElement().setId("localCSVFileChooser"); | |
185 for( int i=0; i<sources; i++ ){ | 189 for( int i=0; i<sources; i++ ){ |
186 try { | 190 try { |
187 if( core.hasItems(i) ){ | 191 if( core.hasItems(i) ){ |
188 try { | 192 try { |
189 ListBox staticData = new ListBox(); | 193 ListBox staticData = new ListBox(); |
259 //TODO: if this remains in the code, the check below has | 263 //TODO: if this remains in the code, the check below has |
260 //to be improved (some constant somewhere) | 264 //to be improved (some constant somewhere) |
261 if( label.equals("local KML") ){ | 265 if( label.equals("local KML") ){ |
262 openPanel.setWidget(0, 1, uploadKML); | 266 openPanel.setWidget(0, 1, uploadKML); |
263 } | 267 } |
268 //skruse: test for local CSV loading | |
269 //TODO: if this remains in the code, the check below has | |
270 //to be improved (some constant somewhere) | |
271 if( label.equals("local CSV") ){ | |
272 openPanel.setWidget(0, 1, uploadCSV); | |
273 } | |
264 else if( staticListBoxes.get(ds) == null ){ | 274 else if( staticListBoxes.get(ds) == null ){ |
265 openPanel.setWidget(0, 1, searchField); | 275 openPanel.setWidget(0, 1, searchField); |
266 } | 276 } |
267 else { | 277 else { |
268 openPanel.setWidget(0, 1, staticListBoxes.get(ds)); | 278 openPanel.setWidget(0, 1, staticListBoxes.get(ds)); |
298 //TODO: if this remains in the code, the check below has | 308 //TODO: if this remains in the code, the check below has |
299 //to be improved (some constant somewhere) | 309 //to be improved (some constant somewhere) |
300 else if( (label.equals("local KML")) && (uploadKML.getFilename() != "") ){ | 310 else if( (label.equals("local KML")) && (uploadKML.getFilename() != "") ){ |
301 String fileName = uploadKML.getFilename(); | 311 String fileName = uploadKML.getFilename(); |
302 core.openLocalKml( ds, fileName ); | 312 core.openLocalKml( ds, fileName ); |
313 } | |
314 //skruse: test for local CSV loading | |
315 //TODO: if this remains in the code, the check below has | |
316 //to be improved (some constant somewhere) | |
317 else if( (label.equals("local CSV")) && (uploadCSV.getFilename() != "") ){ | |
318 String fileName = uploadCSV.getFilename(); | |
319 core.openLocalCsv( ds, fileName ); | |
303 } | 320 } |
304 else if( !searchField.getText().equals("") ){ | 321 else if( !searchField.getText().equals("") ){ |
305 core.openDynamicKml( ds, searchField.getText() ); | 322 core.openDynamicKml( ds, searchField.getText() ); |
306 } | 323 } |
307 openButton.setUrl(constants.openImage()); | 324 openButton.setUrl(constants.openImage()); |