Revision 47347 trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.xml2db/org.gvsig.xml2db.swing/org.gvsig.xml2db.swing.impl/src/main/java/org/gvsig/xml2db/swing/impl/createdbfromxml/CreatedbFromXmlPanel.java
CreatedbFromXmlPanel.java | ||
---|---|---|
168 | 168 |
|
169 | 169 |
this.pickerXMLFile = toolsSwingManager.createFilePickerController( |
170 | 170 |
this.txtXMLFile, |
171 |
this.btnXMLFile |
|
171 |
this.btnXMLFile, |
|
172 |
null, |
|
173 |
"Xml2db_xmlFile", |
|
174 |
null, |
|
175 |
true |
|
176 |
|
|
172 | 177 |
); |
173 | 178 |
this.pickerXMLFile.addChangeListener((ChangeEvent e) -> { |
174 | 179 |
doChangeXMLfile(); |
... | ... | |
239 | 244 |
toolsSwingManager.translate(this.btnAnalizeXML); |
240 | 245 |
toolsSwingManager.translate(this.btnViewTableStructure); |
241 | 246 |
toolsSwingManager.translate(this.lblRegisterConnection); |
247 |
toolsSwingManager.translate(this.lblOverwriteDatabase); |
|
242 | 248 |
toolsSwingManager.translate(this.lblLocale); |
243 | 249 |
|
244 | 250 |
} |
... | ... | |
269 | 275 |
this.pickerCharset.setEnabled(true); |
270 | 276 |
this.pickerProjection.setEnabled(true); |
271 | 277 |
|
278 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
272 | 279 |
File xmlfile = this.pickerXMLFile.get(); |
273 | 280 |
if( xmlfile == null || !xmlfile.exists() ) { |
274 | 281 |
if( xmlfile==null ) { |
275 |
this.message("_XML_file_is_required", JOptionPane.WARNING_MESSAGE);
|
|
282 |
this.message(i18n.getTranslation("_XML_file_is_required"), JOptionPane.WARNING_MESSAGE);
|
|
276 | 283 |
} else { |
277 |
this.message("_XML_file_not_exists", JOptionPane.WARNING_MESSAGE);
|
|
284 |
this.message(i18n.getTranslation("_XML_file_not_exists"), JOptionPane.WARNING_MESSAGE);
|
|
278 | 285 |
} |
279 | 286 |
this.btnAnalizeXML.setEnabled(false); |
280 | 287 |
this.lstTables.setEnabled(false); |
... | ... | |
287 | 294 |
this.btnAnalizeXML.setEnabled(true); |
288 | 295 |
if( this.lstTables.getModel().getSize()<1 ) { |
289 | 296 |
if( this.xmlinfo == null ) { |
290 |
this.message("_Analize_XML_required", JOptionPane.WARNING_MESSAGE);
|
|
297 |
this.message(i18n.getTranslation("_Analize_XML_required"), JOptionPane.WARNING_MESSAGE);
|
|
291 | 298 |
} else { |
292 |
this.message("_No_tables_recognized_in_the_XML", JOptionPane.WARNING_MESSAGE);
|
|
299 |
this.message(i18n.getTranslation("_No_tables_recognized_in_the_XML"), JOptionPane.WARNING_MESSAGE);
|
|
293 | 300 |
} |
294 | 301 |
this.btnViewTableStructure.setEnabled(false); |
295 | 302 |
if( this.dialog!=null ) { |
... | ... | |
310 | 317 |
this.btnViewTableStructure.setEnabled(true); |
311 | 318 |
File dbfile = this.pickerDbfile.get(); |
312 | 319 |
if( dbfile == null ) { |
313 |
this.message("_Database_file_is_required", JOptionPane.WARNING_MESSAGE);
|
|
320 |
this.message(i18n.getTranslation("_Database_file_is_required"), JOptionPane.WARNING_MESSAGE);
|
|
314 | 321 |
if( this.dialog!=null ) { |
315 | 322 |
this.dialog.setButtonEnabled(WindowManager_v2.BUTTON_OK, false); |
316 | 323 |
} |
317 | 324 |
return; |
318 | 325 |
} |
319 | 326 |
if( H2SpatialUtils.existsH2db(dbfile) && !this.chkOverwriteDatabase.isSelected() ) { |
320 |
this.message("_Database_file_already_exists", JOptionPane.WARNING_MESSAGE);
|
|
327 |
this.message(i18n.getTranslation("_Database_file_already_exists"), JOptionPane.WARNING_MESSAGE);
|
|
321 | 328 |
if( this.dialog!=null ) { |
322 | 329 |
this.dialog.setButtonEnabled(WindowManager_v2.BUTTON_OK, false); |
323 | 330 |
} |
324 | 331 |
return; |
325 | 332 |
} |
326 | 333 |
if( StringUtils.isBlank(this.txtRepositoryName.getText()) ) { |
327 |
this.message("_Repository_name_is_required", JOptionPane.WARNING_MESSAGE);
|
|
334 |
this.message(i18n.getTranslation("_Repository_name_is_required"), JOptionPane.WARNING_MESSAGE);
|
|
328 | 335 |
if( this.dialog!=null ) { |
329 | 336 |
this.dialog.setButtonEnabled(WindowManager_v2.BUTTON_OK, false); |
330 | 337 |
} |
... | ... | |
369 | 376 |
|
370 | 377 |
Xml2dbManager manager = Xml2dbLocator.getXml2dbManager(); |
371 | 378 |
|
379 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
372 | 380 |
if( H2SpatialUtils.existsH2db(dbfile) ) { |
373 | 381 |
if( !this.chkOverwriteDatabase.isSelected() ) { |
374 |
message("Database already exists", JOptionPane.WARNING_MESSAGE);
|
|
382 |
message(i18n.getTranslation("Database already exists"), JOptionPane.WARNING_MESSAGE);
|
|
375 | 383 |
return; |
376 | 384 |
} |
377 | 385 |
} |
378 | 386 |
|
379 | 387 |
this.lastTask = new Task( |
380 | 388 |
"Xml2db_Creating_database", |
381 |
"Create databse",
|
|
389 |
i18n.getTranslation("_Create_database"),
|
|
382 | 390 |
this::updateStateComponents, |
383 | 391 |
taskStatusController |
384 | 392 |
) { |
... | ... | |
386 | 394 |
protected void task(SimpleTaskStatus taskStatus) throws Throwable{ |
387 | 395 |
try { |
388 | 396 |
if( H2SpatialUtils.existsH2db(dbfile) ) { |
389 |
taskStatus.message("Removing existing database...");
|
|
397 |
taskStatus.message(i18n.getTranslation("_Removing_existing_database"));
|
|
390 | 398 |
H2SpatialUtils.server_stop(); |
391 | 399 |
H2SpatialUtils.removeH2db(dbfile); |
392 | 400 |
H2SpatialUtils.server_start(); |
... | ... | |
428 | 436 |
IProjection proj = this.pickerProjection.get(); |
429 | 437 |
Charset charset = this.pickerCharset.get(); |
430 | 438 |
Locale locale = this.pickerLocale.get(); |
439 |
|
|
440 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
431 | 441 |
|
432 | 442 |
this.lastTask = new Task( |
433 | 443 |
"Xml2db_AnalizeXML", |
434 |
"Analize XML",
|
|
444 |
i18n.getTranslation("_Analize_xml"),
|
|
435 | 445 |
this::updateStateComponents, |
436 | 446 |
taskStatusController |
437 | 447 |
) { |
Also available in: Unified diff