Revision 37781 branches/v2_0_0_prep/extensions/org.gvsig.exportto.app/org.gvsig.exportto.app.extension/src/main/java/org/gvsig/exportto/app/extension/LoadTableAction.java
LoadTableAction.java | ||
---|---|---|
42 | 42 |
import org.gvsig.fmap.dal.exception.ValidateDataParametersException; |
43 | 43 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
44 | 44 |
|
45 |
|
|
46 | 45 |
/** |
47 | 46 |
* @author gvSIG Team |
48 | 47 |
* @version $Id$ |
49 |
* |
|
48 |
*
|
|
50 | 49 |
*/ |
51 |
public class LoadTableAction implements ExporttoServiceFinishAction{ |
|
52 |
private static final Logger LOG = LoggerFactory.getLogger(LoadLayerAction.class); |
|
50 |
public class LoadTableAction implements ExporttoServiceFinishAction { |
|
51 |
|
|
52 |
private static final Logger LOG = LoggerFactory |
|
53 |
.getLogger(LoadLayerAction.class); |
|
53 | 54 |
private static final DataManager DATA_MANAGER = DALLocator.getDataManager(); |
54 | 55 |
|
55 | 56 |
public LoadTableAction() { |
56 |
super();
|
|
57 |
super(); |
|
57 | 58 |
} |
58 | 59 |
|
59 | 60 |
public void finished(String tableName, |
60 | 61 |
DataStoreParameters dataStoreParameters) { |
61 | 62 |
|
62 |
int res = JOptionPane.showConfirmDialog((JComponent) PluginServices.getMDIManager().getActiveWindow(), |
|
63 |
PluginServices.getText(this,"add_table_to_project"), |
|
64 |
PluginServices.getText(this, "add_table"), |
|
65 |
JOptionPane.YES_NO_OPTION); |
|
63 |
int res = |
|
64 |
JOptionPane.showConfirmDialog((JComponent) PluginServices |
|
65 |
.getMDIManager().getActiveWindow(), PluginServices.getText( |
|
66 |
this, "add_table_to_project"), PluginServices.getText(this, |
|
67 |
"add_table"), JOptionPane.YES_NO_OPTION); |
|
66 | 68 |
|
67 |
if (res == JOptionPane.YES_OPTION) { |
|
68 |
try{ |
|
69 |
FeatureStore featureStore = (FeatureStore)DATA_MANAGER.openStore(dataStoreParameters.getDataStoreName(), dataStoreParameters); |
|
70 |
TableDocument tableDocument = (TableDocument) ProjectManager.getInstance().createDocument( |
|
71 |
TableManager.TYPENAME, tableName); |
|
69 |
if (res == JOptionPane.YES_OPTION) { |
|
70 |
try { |
|
71 |
FeatureStore featureStore = |
|
72 |
(FeatureStore) DATA_MANAGER.openStore( |
|
73 |
dataStoreParameters.getDataStoreName(), |
|
74 |
dataStoreParameters); |
|
75 |
TableDocument tableDocument = |
|
76 |
(TableDocument) ProjectManager.getInstance() |
|
77 |
.createDocument(TableManager.TYPENAME, tableName); |
|
72 | 78 |
tableDocument.setStore(featureStore); |
73 | 79 |
|
74 |
ApplicationLocator.getManager().getProjectManager().getCurrentProject().add(tableDocument); |
|
75 |
// FeatureTableDocumentPanel featureTableDocumentPanel = |
|
76 |
// new FeatureTableDocumentPanel(tableDocument); |
|
80 |
ApplicationLocator.getManager().getProjectManager() |
|
81 |
.getCurrentProject().add(tableDocument); |
|
82 |
// FeatureTableDocumentPanel featureTableDocumentPanel = |
|
83 |
// new FeatureTableDocumentPanel(tableDocument); |
|
77 | 84 |
// |
78 |
// MDI_MANAGER.addWindow(featureTableDocumentPanel);
|
|
85 |
// MDI_MANAGER.addWindow(featureTableDocumentPanel);
|
|
79 | 86 |
} catch (ValidateDataParametersException e) { |
80 | 87 |
LOG.error("Error opening the exported table", e); |
81 | 88 |
} catch (InitializeException e) { |
Also available in: Unified diff