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

View differences:

RenameFieldCommand.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 RenameFieldCommand extends AbstractCommand {
51
	
52
	EditableAdapter edAdapter; 
49

  
50
	EditableAdapter edAdapter;
53 51
	InternalField field;
54 52
	String antName;
55 53
	String newName;
56
	
54

  
57 55
	public RenameFieldCommand(EditableAdapter edAdapter, InternalField field, String newName)
58 56
	{
59 57
		this.edAdapter = edAdapter;
......
61 59
		antName = field.getFieldDesc().getFieldAlias();
62 60
		this.newName = newName;
63 61
	}
64
	
65 62

  
66
	public void undo() throws DriverIOException, IOException {
67
		try {
68
			edAdapter.undoRenameField(field, antName);
69
		} catch (EditionException e) {
70
			// TODO Auto-generated catch block
71
			e.printStackTrace();
72
		}
63

  
64
	public void undo() throws EditionCommandException {
65
		edAdapter.undoRenameField(field, antName);
73 66
	}
74 67

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

  
85 76
	public String getType() {

Also available in: Unified diff