Revision 4475 trunk/applications/appgvSIG/src/com/iver/cit/gvsig/TableEditStopExtension.java

View differences:

TableEditStopExtension.java
6 6
import com.iver.andami.messages.NotificationManager;
7 7
import com.iver.andami.plugins.Extension;
8 8
import com.iver.andami.ui.mdiManager.View;
9
import com.iver.cit.gvsig.fmap.edition.IEditableSource;
9 10
import com.iver.cit.gvsig.gui.Table;
10 11

  
11 12

  
......
25 26
     * @see com.iver.andami.plugins.Extension#execute(java.lang.String)
26 27
     */
27 28
    public void execute(String actionCommand) {
29
    	View v = PluginServices.getMDIManager().getActiveView();
30
    	Table table = (Table) v;
28 31
        if ("ROLLBACK".equals(actionCommand)) {
29
            View v = PluginServices.getMDIManager().getActiveView();
30 32
             try {
31
				((Table) v).cancelEditing();
33
				table.cancelEditing();
32 34
			} catch (IOException e) {
33 35
				NotificationManager.addError("No se pudo cancelar la edici?n", e);
34 36
			}
35 37
        } else if ("COMMIT".equals(actionCommand)) {
36
            View v = PluginServices.getMDIManager().getActiveView();
37
            ((Table) v).stopEditing();
38
            table.stopEditing();
38 39

  
39 40
        }
41
		IEditableSource edTable = (IEditableSource) table.getModel().getAssociatedTable();
42
		edTable.getCommandRecord().removeCommandListener(table);
43

  
40 44
    }
41 45

  
42 46
    /**

Also available in: Unified diff