Revision 400 trunk/org.gvsig.gdal/org.gvsig.gdal.app/org.gvsig.gdal.app.ogr.mainplugin/src/main/java/org/gvsig/gdal/app/ogr/mainplugin/gui/JOGRDataExplorerController.java
JOGRDataExplorerController.java | ||
---|---|---|
28 | 28 |
import java.io.File; |
29 | 29 |
import java.util.ArrayList; |
30 | 30 |
import java.util.Arrays; |
31 |
import java.util.Collections; |
|
31 | 32 |
import java.util.List; |
32 | 33 |
import java.util.Locale; |
33 | 34 |
import java.util.prefs.Preferences; |
... | ... | |
38 | 39 |
import javax.swing.ListSelectionModel; |
39 | 40 |
import javax.swing.event.ListSelectionEvent; |
40 | 41 |
import javax.swing.event.ListSelectionListener; |
42 |
import javax.swing.table.TableModel; |
|
41 | 43 |
|
42 | 44 |
import org.apache.commons.lang.StringUtils; |
43 | 45 |
import org.apache.commons.lang3.ArrayUtils; |
... | ... | |
403 | 405 |
ProviderNotRegisteredException { |
404 | 406 |
|
405 | 407 |
OGRDataStoreParameterTableModel model = getOGRTableModel(); |
406 |
|
|
408 |
if( model == null ) { |
|
409 |
return Collections.EMPTY_LIST; |
|
410 |
} |
|
407 | 411 |
int[] selectedRows = layerTable.getSelectedRows(); |
408 | 412 |
List<DataStoreParameters> parameters = new ArrayList<DataStoreParameters>(); |
409 | 413 |
for (int i = 0; i < selectedRows.length; i++) { |
... | ... | |
424 | 428 |
} |
425 | 429 |
|
426 | 430 |
private OGRDataStoreParameterTableModel getOGRTableModel() { |
427 |
return (OGRDataStoreParameterTableModel) layerTable.getModel(); |
|
431 |
TableModel model = layerTable.getModel(); |
|
432 |
if( model instanceof OGRDataStoreParameterTableModel) { |
|
433 |
return (OGRDataStoreParameterTableModel) model; |
|
434 |
} |
|
435 |
return null; |
|
428 | 436 |
} |
429 | 437 |
} |
Also available in: Unified diff