svn-gvsig-desktop / trunk / libraries / libDataSource / src / org / gvsig / data / commands / implementation / DeleteAttributeCommand.java @ 20606
History | View | Annotate | Download (1.26 KB)
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 DeleteAttributeCommand extends AttributeCommand{ |
8 |
|
9 |
|
10 |
public DeleteAttributeCommand(AttributeManager attributeManager, IFeatureAttributeDescriptor attributeDescriptor) {
|
11 |
super(attributeManager,attributeDescriptor);
|
12 |
} |
13 |
|
14 |
public DeleteAttributeCommand(AttributeManager attributeManager, IFeatureAttributeDescriptor attributeDescriptor, String description) { |
15 |
super(attributeManager,attributeDescriptor, description);
|
16 |
} |
17 |
|
18 |
/* (non-Javadoc)
|
19 |
* @see org.gvsig.data.commands.ICommand#undo()
|
20 |
*/
|
21 |
public void undo() { |
22 |
attributeManager.restoreAttribute(new Integer(attributeDescriptor.ordinal())); |
23 |
} |
24 |
|
25 |
/* (non-Javadoc)
|
26 |
* @see org.gvsig.data.commands.ICommand#redo()
|
27 |
*/
|
28 |
public void redo() { |
29 |
execute(); |
30 |
|
31 |
} |
32 |
|
33 |
/* (non-Javadoc)
|
34 |
* @see org.gvsig.data.commands.ICommand#getType()
|
35 |
*/
|
36 |
public String getType() { |
37 |
return ICommand.DELETE;
|
38 |
} |
39 |
|
40 |
/* (non-Javadoc)
|
41 |
* @see org.gvsig.data.commands.ICommand#execute()
|
42 |
*/
|
43 |
public void execute() { |
44 |
attributeManager.deleteAttribute(new Integer(attributeDescriptor.ordinal())); |
45 |
} |
46 |
|
47 |
} |