Revision 6609 trunk/applications/appgvSIG/src/com/iver/cit/gvsig/TableEditStartExtension.java
TableEditStartExtension.java | ||
---|---|---|
44 | 44 |
import com.iver.andami.plugins.Extension; |
45 | 45 |
import com.iver.andami.ui.mdiManager.View; |
46 | 46 |
import com.iver.cit.gvsig.fmap.edition.EditionException; |
47 |
import com.iver.cit.gvsig.fmap.edition.IEditableSource; |
|
48 |
import com.iver.cit.gvsig.fmap.edition.IWriteable; |
|
47 | 49 |
import com.iver.cit.gvsig.gui.Table; |
48 | 50 |
|
49 | 51 |
|
... | ... | |
84 | 86 |
* @see com.iver.andami.plugins.IExtension#isEnabled() |
85 | 87 |
*/ |
86 | 88 |
public boolean isEnabled() { |
87 |
return true; |
|
89 |
View v = PluginServices.getMDIManager().getActiveView(); |
|
90 |
|
|
91 |
if (v == null) { |
|
92 |
return false; |
|
93 |
} |
|
94 |
if (v instanceof Table) |
|
95 |
{ |
|
96 |
Table t = (Table) v; |
|
97 |
IEditableSource ies = t.getModel().getModelo(); |
|
98 |
if (ies.getOriginalDriver() instanceof IWriteable) |
|
99 |
{ |
|
100 |
return true; |
|
101 |
} |
|
102 |
} |
|
103 |
return false; |
|
88 | 104 |
} |
89 | 105 |
|
90 | 106 |
/** |
... | ... | |
98 | 114 |
} |
99 | 115 |
|
100 | 116 |
if (v instanceof Table && !((Table) v).isEditing() && ((Table)v).getModel().getAssociatedTable()==null) { |
101 |
return true;
|
|
117 |
return true;
|
|
102 | 118 |
} |
103 | 119 |
|
104 | 120 |
return false; |
Also available in: Unified diff