root / trunk / extensions / extTableImport / src / org / gvsig / tableImport / importfields / ImportFieldsAction.java @ 28459
History | View | Annotate | Download (1.37 KB)
1 |
package org.gvsig.tableImport.importfields; |
---|---|
2 |
|
3 |
import jwizardcomponent.FinishAction; |
4 |
|
5 |
import com.iver.andami.PluginServices; |
6 |
import com.iver.andami.messages.NotificationManager; |
7 |
import com.iver.andami.ui.mdiManager.IWindow; |
8 |
import com.iver.andami.ui.wizard.WizardAndami; |
9 |
import com.iver.cit.gvsig.project.documents.table.gui.Table; |
10 |
|
11 |
public class ImportFieldsAction extends FinishAction { |
12 |
|
13 |
private WizardAndami wizard;
|
14 |
private ImportFieldParams params;
|
15 |
|
16 |
public ImportFieldsAction(WizardAndami wizard,ImportFieldParams params) {
|
17 |
super(wizard.getWizardComponents());
|
18 |
|
19 |
this.wizard = wizard;
|
20 |
this.params = params;
|
21 |
} |
22 |
|
23 |
public void performAction() { |
24 |
if (params.isValid()){
|
25 |
ImportFieldsExtension ext = (ImportFieldsExtension) PluginServices.getExtension(ImportFieldsExtension.class); |
26 |
try {
|
27 |
ext.doImportField(this.params);
|
28 |
} catch (Exception e) { |
29 |
NotificationManager.addError(e); |
30 |
return;
|
31 |
} |
32 |
|
33 |
} |
34 |
PluginServices.getMDIManager().closeWindow(this.wizard);
|
35 |
|
36 |
//TODO: Cuando la tabla es de una capa y no esta en edici?n no se refresca
|
37 |
IWindow[] windows = PluginServices.getMDIManager().getAllWindows();
|
38 |
Table tableWindow; |
39 |
for (int i=0;i<windows.length;i++){ |
40 |
if (windows[i] instanceof Table){ |
41 |
tableWindow = (Table) windows[i]; |
42 |
if (tableWindow.getModel().equals(params.getTable())){
|
43 |
tableWindow.setModel(params.getTable()); |
44 |
break;
|
45 |
} |
46 |
} |
47 |
} |
48 |
} |
49 |
|
50 |
} |