Revision 10627 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/edition/commands/RemoveFieldCommand.java

View differences:

RemoveFieldCommand.java
40 40
 */
41 41
package com.iver.cit.gvsig.fmap.edition.commands;
42 42

  
43
import java.io.IOException;
44

  
45
import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
43
import com.hardcode.gdbms.driver.exceptions.ReadDriverException;
44
import com.iver.cit.gvsig.exceptions.commands.EditionCommandException;
46 45
import com.iver.cit.gvsig.fmap.edition.EditableAdapter;
47
import com.iver.cit.gvsig.fmap.edition.EditionException;
48 46
import com.iver.cit.gvsig.fmap.edition.InternalField;
49 47

  
50 48
public class RemoveFieldCommand extends AbstractCommand {
51
	
52
	EditableAdapter edAdapter; 
49

  
50
	EditableAdapter edAdapter;
53 51
	InternalField field;
54
	
52

  
55 53
	public RemoveFieldCommand(EditableAdapter edAdapter, InternalField fieldDesc)
56 54
	{
57 55
		this.edAdapter = edAdapter;
58 56
		this.field = fieldDesc;
59 57
	}
60
	
61 58

  
62
	public void undo() throws DriverIOException, IOException {
63
		try {
64
			edAdapter.undoRemoveField(field);
65
		} catch (EditionException e) {
66
			// TODO Auto-generated catch block
67
			e.printStackTrace();
68
		}
59

  
60
	public void undo() throws EditionCommandException {
61
		edAdapter.undoRemoveField(field);
69 62
	}
70 63

  
71
	public void redo() throws DriverIOException, IOException {
64
	public void redo() throws EditionCommandException {
72 65
		try {
73 66
			edAdapter.doRemoveField(field);
74
		} catch (EditionException e) {
75
			// TODO Auto-generated catch block
76
			e.printStackTrace();
67
		} catch (ReadDriverException e) {
68
			throw new EditionCommandException(edAdapter.getWriter().getName(),e);
77 69
		}
78
		
79 70
	}
80 71

  
81 72
	public String getType() {

Also available in: Unified diff