root / branches / Mobile_Compatible_Hito_1 / libFMap / src-data / org / gvsig / data / commands / implementation / InsertAttributeCommand.java @ 21606
History | View | Annotate | Download (939 Bytes)
1 |
package org.gvsig.data.commands.implementation; |
---|---|
2 |
|
3 |
import org.gvsig.data.commands.ICommand; |
4 |
import org.gvsig.data.vectorial.IFeatureAttributeDescriptor; |
5 |
import org.gvsig.data.vectorial.expansionadapter.AttributeManager; |
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(attributeDescriptor.getName()); |
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 |
} |