|
@@ -72,7 +72,16 @@ public class ExtractSubdiagramRefactoring extends AbstractRefactoring<View> {
|
|
|
|
|
|
@Override
|
|
|
protected boolean internalDoUndo() {
|
|
|
- return DiagramPartitioningUtil.closeSubdiagramEditors((State) subdiagram.getElement());
|
|
|
+ boolean close = DiagramPartitioningUtil.closeSubdiagramEditors((State) subdiagram.getElement());
|
|
|
+ if (!close)
|
|
|
+ return false;
|
|
|
+ // Since the canonical edit policy creates edges for the semantic
|
|
|
+ // transitions and it is not done within the TransactionalCommand we
|
|
|
+ // have to delete the created edges manually when undo is executed.
|
|
|
+ while (subdiagram.getEdges().size() > 0) {
|
|
|
+ EcoreUtil.delete((EObject) subdiagram.getEdges().get(0));
|
|
|
+ }
|
|
|
+ return true;
|
|
|
}
|
|
|
|
|
|
@SuppressWarnings("unchecked")
|