Revision 46390 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/FeatureDeleteCommand.java
FeatureDeleteCommand.java | ||
---|---|---|
26 | 26 |
import org.gvsig.fmap.dal.exception.DataException; |
27 | 27 |
import org.gvsig.fmap.dal.feature.Feature; |
28 | 28 |
import org.gvsig.fmap.dal.feature.impl.DefaultFeatureStore; |
29 |
import org.gvsig.fmap.dal.feature.impl.editing.memory.FeatureManager; |
|
30 |
import org.gvsig.tools.undo.RedoException; |
|
29 | 31 |
import org.gvsig.tools.undo.UndoException; |
30 | 32 |
|
31 | 33 |
|
... | ... | |
43 | 45 |
|
44 | 46 |
public void undo() throws UndoException { |
45 | 47 |
try { |
46 |
featureStore.doInsert(feature.getEditable()); |
|
47 |
} catch (DataException e) { |
|
48 |
FeatureManager featureManager = featureStore.getFeatureManager(); |
|
49 |
featureManager.restore(feature.getReference()); |
|
50 |
} catch (Exception e) { |
|
48 | 51 |
throw new UndoException(this, e); |
49 | 52 |
} |
50 | 53 |
} |
51 | 54 |
|
55 |
@Override |
|
56 |
public void redo() throws RedoException { |
|
57 |
try { |
|
58 |
featureStore.doDelete(feature); |
|
59 |
} catch (Exception e) { |
|
60 |
throw new RedoException(this, e); |
|
61 |
} |
|
62 |
} |
|
63 |
|
|
52 | 64 |
public int getType() { |
53 | 65 |
return DELETE; |
54 | 66 |
} |
Also available in: Unified diff