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/OGRWizarPanel.java
OGRWizarPanel.java | ||
---|---|---|
33 | 33 |
import org.gvsig.fmap.dal.DataStoreParameters; |
34 | 34 |
import org.gvsig.gdal.prov.ogr.OGRDataStoreParameters; |
35 | 35 |
import org.gvsig.tools.ToolsLocator; |
36 |
import org.gvsig.tools.exception.BaseException; |
|
37 | 36 |
import org.gvsig.tools.i18n.I18nManager; |
38 | 37 |
import org.slf4j.Logger; |
39 | 38 |
import org.slf4j.LoggerFactory; |
... | ... | |
51 | 50 |
|
52 | 51 |
private static final String TAB_NAME = "OGR"; |
53 | 52 |
|
54 |
private JOGRDataExplorer component; |
|
53 |
private final JOGRDataExplorer component;
|
|
55 | 54 |
|
56 | 55 |
/** |
57 | 56 |
* |
... | ... | |
71 | 70 |
|
72 | 71 |
@Override |
73 | 72 |
public void execute() { |
73 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
74 | 74 |
|
75 | 75 |
String connectionString = this.component.getConnectionString(); |
76 | 76 |
|
... | ... | |
78 | 78 |
return; |
79 | 79 |
} |
80 | 80 |
|
81 |
List<DataStoreParameters> layerProperties = null;
|
|
81 |
List<DataStoreParameters> layerProperties; |
|
82 | 82 |
try { |
83 | 83 |
layerProperties = this.component.getSelectedLayerProperties(); |
84 |
} catch (BaseException e) {
|
|
85 |
LOG.error("Can not get properties of selected layers", e);
|
|
84 |
} catch (Throwable e) {
|
|
85 |
LOG.warn("Can not get properties of selected layers", e);
|
|
86 | 86 |
|
87 |
I18nManager i18nManager = ToolsLocator.getI18nManager(); |
|
88 | 87 |
JOptionPane.showMessageDialog(component.asJComponent(), |
89 |
i18nManager.getTranslation("error_getting_selected_layer_properties"),
|
|
90 |
i18nManager.getTranslation("error"), JOptionPane.ERROR_MESSAGE);
|
|
88 |
i18n.getTranslation("error_getting_selected_layer_properties"), |
|
89 |
i18n.getTranslation("error"), JOptionPane.ERROR_MESSAGE); |
|
91 | 90 |
return; |
92 | 91 |
} |
93 |
|
|
92 |
|
|
93 |
if( layerProperties==null || layerProperties.isEmpty() ) { |
|
94 |
JOptionPane.showMessageDialog(component.asJComponent(), |
|
95 |
i18n.getTranslation("_You_must_select_at_least_one_layer")+"\n\n"+ |
|
96 |
i18n.getTranslation("_Make_sure_that_in_addition_to_selecting_a_file_click_on_the_open_button_and_you_have_selected_at_least_one_layer_from_the_list"), |
|
97 |
i18n.getTranslation("_Warning"), |
|
98 |
JOptionPane.WARNING_MESSAGE); |
|
99 |
return; |
|
100 |
} |
|
94 | 101 |
for (DataStoreParameters parameters : layerProperties) { |
95 | 102 |
|
96 | 103 |
OGRDataStoreParameters ogrParameters = (OGRDataStoreParameters) parameters; |
Also available in: Unified diff