Revision 10627 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/edition/commands/ModifyRowCommand.java
ModifyRowCommand.java | ||
---|---|---|
2 | 2 |
|
3 | 3 |
import java.io.IOException; |
4 | 4 |
|
5 |
import com.hardcode.gdbms.driver.exceptions.ReadDriverException; |
|
6 |
import com.iver.cit.gvsig.exceptions.commands.EditionCommandException; |
|
7 |
import com.iver.cit.gvsig.exceptions.expansionfile.ExpansionFileReadException; |
|
8 |
import com.iver.cit.gvsig.exceptions.expansionfile.ExpansionFileWriteException; |
|
5 | 9 |
import com.iver.cit.gvsig.fmap.core.IRow; |
6 | 10 |
import com.iver.cit.gvsig.fmap.drivers.DriverIOException; |
11 |
import com.iver.cit.gvsig.fmap.edition.EditableAdapter; |
|
7 | 12 |
import com.iver.cit.gvsig.fmap.edition.EditionEvent; |
8 | 13 |
import com.iver.cit.gvsig.fmap.edition.IEditableSource; |
9 | 14 |
|
10 | 15 |
public class ModifyRowCommand extends AbstractCommand { |
11 | 16 |
|
12 |
private IEditableSource efs;
|
|
17 |
private EditableAdapter efs;
|
|
13 | 18 |
private IRow rowNext; |
14 | 19 |
private int calculatedIndexAnt; |
15 | 20 |
private int previousIndexInExpansionFile; |
... | ... | |
22 | 27 |
* @throws IOException |
23 | 28 |
* @throws DriverIOException |
24 | 29 |
*/ |
25 |
public ModifyRowCommand(IEditableSource ef,int calculatedIndex,int previousInExpansionFile,IRow newRow,int type) throws IOException, DriverIOException{
|
|
30 |
public ModifyRowCommand(EditableAdapter ef,int calculatedIndex,int previousInExpansionFile,IRow newRow,int type){
|
|
26 | 31 |
super(); |
27 | 32 |
efs=ef; |
28 | 33 |
calculatedIndexAnt=calculatedIndex; |
... | ... | |
35 | 40 |
* @throws IOException |
36 | 41 |
* @see com.iver.cit.gvsig.fmap.edition.Command#undo() |
37 | 42 |
*/ |
38 |
public void undo() throws IOException, DriverIOException {
|
|
43 |
public void undo() throws EditionCommandException {
|
|
39 | 44 |
efs.undoModifyRow(calculatedIndexAnt,previousIndexInExpansionFile,type); |
40 | 45 |
} |
41 | 46 |
/** |
... | ... | |
43 | 48 |
* @throws IOException |
44 | 49 |
* @see com.iver.cit.gvsig.fmap.edition.Command#redo() |
45 | 50 |
*/ |
46 |
public void redo() throws IOException, DriverIOException { |
|
47 |
efs.doModifyRow(calculatedIndexAnt,rowNext,type); |
|
51 |
public void redo() throws EditionCommandException { |
|
52 |
try { |
|
53 |
efs.doModifyRow(calculatedIndexAnt,rowNext,type); |
|
54 |
} catch (ExpansionFileWriteException e) { |
|
55 |
throw new EditionCommandException(efs.getWriter().getName(),e); |
|
56 |
} catch (ReadDriverException e) { |
|
57 |
throw new EditionCommandException(efs.getWriter().getName(),e); |
|
58 |
} catch (ExpansionFileReadException e) { |
|
59 |
throw new EditionCommandException(efs.getWriter().getName(),e); |
|
48 | 60 |
} |
61 |
} |
|
49 | 62 |
public String getType() { |
50 | 63 |
return "Modify"; |
51 | 64 |
} |
Also available in: Unified diff