Statistics
| Revision:

root / trunk / libraries / libDataSource / src / org / gvsig / data / commands / implementation / InsertAttributeCommand.java @ 20469

History | View | Annotate | Download (968 Bytes)

1
package org.gvsig.data.commands.implementation;
2

    
3
import org.gvsig.data.commands.ICommand;
4
import org.gvsig.data.vectorial.AttributeManager;
5
import org.gvsig.data.vectorial.IFeatureAttributeDescriptor;
6

    
7
public class InsertAttributeCommand extends AbstractAttributeCommand{
8

    
9
        public InsertAttributeCommand(AttributeManager attributeManager, IFeatureAttributeDescriptor attributeDescriptor) {
10
                super(attributeManager,attributeDescriptor);
11
        }
12

    
13
        public InsertAttributeCommand(AttributeManager attributeManager, IFeatureAttributeDescriptor attributeDescriptor, String description) {
14
                super(attributeManager,attributeDescriptor, description);
15
        }
16

    
17
        public void undo() {
18
                 attributeManager.deleteLastAttribute(new Integer(attributeDescriptor.ordinal()));
19
        }
20

    
21
        public void redo() {
22
                execute();
23
        }
24

    
25
        public String getType() {
26
                return ICommand.INSERT;
27
        }
28

    
29
        public void execute() {
30
                 attributeManager.addAttribute(attributeDescriptor);
31
        }
32

    
33
}