Revision 24962 branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/RemoveTableLink.java
RemoveTableLink.java | ||
---|---|---|
40 | 40 |
*/ |
41 | 41 |
package com.iver.cit.gvsig; |
42 | 42 |
|
43 |
import org.gvsig.project.document.table.FeatureTableDocument; |
|
44 |
import org.gvsig.project.document.table.gui.FeatureTableDocumentPanel; |
|
45 |
|
|
43 | 46 |
import com.iver.andami.PluginServices; |
44 | 47 |
import com.iver.andami.plugins.Extension; |
45 | 48 |
import com.iver.andami.ui.mdiManager.IWindow; |
46 |
import com.iver.cit.gvsig.project.documents.table.ProjectTable; |
|
47 |
import com.iver.cit.gvsig.project.documents.table.gui.Table; |
|
48 | 49 |
|
49 | 50 |
|
50 | 51 |
/** |
... | ... | |
64 | 65 |
* @see com.iver.andami.plugins.IExtension#execute(java.lang.String) |
65 | 66 |
*/ |
66 | 67 |
public void execute(String actionCommand) { |
67 |
Table t = (Table) PluginServices.getMDIManager().getActiveWindow();
|
|
68 |
ProjectTable pt = t.getModel();
|
|
68 |
FeatureTableDocumentPanel t = (FeatureTableDocumentPanel) PluginServices.getMDIManager().getActiveWindow();
|
|
69 |
FeatureTableDocument pt = t.getModel();
|
|
69 | 70 |
pt.removeLinkTable();//restoreDataSource(); |
70 | 71 |
t.getModel().setModified(true); |
71 | 72 |
} |
... | ... | |
80 | 81 |
return false; |
81 | 82 |
} |
82 | 83 |
|
83 |
if (v.getClass() == Table.class) {
|
|
84 |
Table t = (Table) v;
|
|
84 |
if (v.getClass() == FeatureTableDocumentPanel.class) {
|
|
85 |
FeatureTableDocumentPanel t = (FeatureTableDocumentPanel) v;
|
|
85 | 86 |
|
86 | 87 |
if (t.getModel().getLinkTable() != null) { |
87 | 88 |
return true; |
... | ... | |
101 | 102 |
return false; |
102 | 103 |
} |
103 | 104 |
|
104 |
if (v instanceof Table) {
|
|
105 |
if (v instanceof FeatureTableDocumentPanel) {
|
|
105 | 106 |
return true; |
106 | 107 |
} else { |
107 | 108 |
return false; |
Also available in: Unified diff