diff 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
line wrap: on
line diff
--- a/src/econnect/wp3_3/client/core/ApplicationGrid.java	Thu Mar 07 14:35:30 2013 +0100
+++ b/src/econnect/wp3_3/client/core/ApplicationGrid.java	Thu Mar 07 14:47:36 2013 +0100
@@ -182,6 +182,10 @@
 			//skruse: The element will be accessed by its ID in the JS code
 			//either don't change this name, or change it also in STICore.js
 			uploadKML.getElement().setId("localKMLFileChooser");
+			final FileUpload uploadCSV = new FileUpload();
+			//skruse: The element will be accessed by its ID in the JS code
+			//either don't change this name, or change it also in STICore.js
+			uploadCSV.getElement().setId("localCSVFileChooser");
 			for( int i=0; i<sources; i++ ){
 				try {
 					if( core.hasItems(i) ){
@@ -261,6 +265,12 @@
 							if( label.equals("local KML") ){
 								openPanel.setWidget(0, 1, uploadKML);
 							}
+							//skruse: test for local CSV loading
+							//TODO: if this remains in the code, the check below has
+							//to be improved (some constant somewhere)
+							if( label.equals("local CSV") ){
+								openPanel.setWidget(0, 1, uploadCSV);
+							}
 							else if( staticListBoxes.get(ds) == null ){
 					    		  openPanel.setWidget(0, 1, searchField);
 						    }
@@ -301,6 +311,13 @@
 							String fileName = uploadKML.getFilename();
 							core.openLocalKml( ds, fileName );
 						}
+						//skruse: test for local CSV loading
+						//TODO: if this remains in the code, the check below has
+						//to be improved (some constant somewhere)
+						else if( (label.equals("local CSV")) && (uploadCSV.getFilename() != "") ){
+							String fileName = uploadCSV.getFilename();
+							core.openLocalCsv( ds, fileName );
+						}
 						else if( !searchField.getText().equals("") ){
 							core.openDynamicKml( ds, searchField.getText() );
 						}