Statistics
| Revision:

svn-gvsig-desktop / tags / J2ME_compat_v1_2_Build_1209 / libraries / libFMap / src / com / iver / cit / gvsig / fmap / edition / commands / RemoveRowCommand.java @ 19509

History | View | Annotate | Download (1.36 KB)

1
package com.iver.cit.gvsig.fmap.edition.commands;
2

    
3
import java.io.IOException;
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.fmap.drivers.DriverIOException;
9
import com.iver.cit.gvsig.fmap.edition.EditableAdapter;
10
import com.iver.cit.gvsig.fmap.edition.EditionEvent;
11

    
12
public class RemoveRowCommand extends AbstractCommand {
13

    
14
        private EditableAdapter efs;
15
        private int index;
16
        private int sourceType=EditionEvent.GRAPHIC;
17
        public RemoveRowCommand(EditableAdapter ef,int i,int sourceType){
18
                super();
19
                efs=ef;
20
                index=i;
21
                this.sourceType=sourceType;
22
        }
23

    
24
        /**
25
         * @throws DriverIOException
26
         * @throws IOException
27
         * @see com.iver.cit.gvsig.fmap.edition.Command#undo()
28
         */
29
        public void undo() throws EditionCommandException {
30
                efs.undoRemoveRow(index,sourceType);
31
        }
32
        /**
33
         * @throws IOException
34
         * @throws DriverIOException
35
         * @see com.iver.cit.gvsig.fmap.edition.Command#redo()
36
         */
37
        public void redo() throws EditionCommandException {
38
                try {
39
                        efs.doRemoveRow(index,sourceType);
40
                } catch (ReadDriverException e) {
41
                        throw new EditionCommandException(efs.getWriter().getName(),e);
42
                } 
43
        }
44

    
45
        public String getType() {
46
                return "Remove";
47
        }
48
}