Revision 45739 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/feature/impl/undo/command/FeatureInsertCommand.java
FeatureInsertCommand.java | ||
---|---|---|
25 | 25 |
|
26 | 26 |
import org.gvsig.fmap.dal.exception.DataException; |
27 | 27 |
import org.gvsig.fmap.dal.feature.EditableFeature; |
28 |
import org.gvsig.fmap.dal.feature.Feature; |
|
29 | 28 |
import org.gvsig.fmap.dal.feature.impl.DefaultFeatureStore; |
30 | 29 |
import org.gvsig.tools.undo.UndoException; |
31 | 30 |
|
... | ... | |
38 | 37 |
public class FeatureInsertCommand extends AbstractFeatureCommand { |
39 | 38 |
|
40 | 39 |
public FeatureInsertCommand(DefaultFeatureStore featureStore, |
41 |
Feature feature, String description) { |
|
40 |
EditableFeature feature, String description) {
|
|
42 | 41 |
super(featureStore, feature, description); |
43 | 42 |
} |
44 | 43 |
|
44 |
@Override |
|
45 |
public EditableFeature getFeature() { |
|
46 |
return (EditableFeature) this.feature; |
|
47 |
} |
|
48 |
|
|
49 |
@Override |
|
45 | 50 |
public void undo() throws UndoException { |
46 | 51 |
try { |
47 |
featureStore.doDelete(((EditableFeature)feature).getNotEditableCopy());
|
|
52 |
featureStore.doDelete(getFeature().getNotEditableCopy());
|
|
48 | 53 |
} catch (DataException e) { |
49 | 54 |
throw new UndoException(this, e); |
50 | 55 |
} |
51 | 56 |
} |
52 | 57 |
|
58 |
@Override |
|
53 | 59 |
public int getType() { |
54 | 60 |
return INSERT; |
55 | 61 |
} |
56 | 62 |
|
63 |
@Override |
|
57 | 64 |
public void execute() throws DataException { |
58 |
featureStore.doInsert((EditableFeature)feature);
|
|
65 |
featureStore.doInsert(getFeature());
|
|
59 | 66 |
} |
60 | 67 |
} |
Also available in: Unified diff