Commit 35d7638c authored by reaboi's avatar reaboi
Browse files

3293 deleting a component having a test suite



GREEN Just to test
Signed-off-by: default avatarreaboi <reaboi@fortiss.org>
parent b09ab4f9
CopyAction.java cc58c9f52b8d0b8698a9905ffadff7c37976481b GREEN
CutAction.java 6e963d94aeea85676beb38489748002b6d13346a GREEN
DeleteAction.java 788b5df59525e069365c4f272b39e0892133e9b9 GREEN
DeleteAction.java 96fd45832167c555b407d7169fc7a3dd03a8fe8d GREEN
PasteAction.java f834f26660a664f138c19d82ace7b17ecc18603f GREEN
RedoAction.java d91086533289a4175e7f5ee949b31a0edc86672a GREEN
RenameAction.java f469d30cab3f692e2e0112c8f89c622ee0fa8db6 GREEN
......
......@@ -236,6 +236,10 @@ public class DeleteAction extends EObjectActionBase<EObject> {
private static void doCompositorBasedDelete(List<EObject> targets) {
// Sort list of deletion targets such that object whose eContainer() is not contained in
// 'targets' are deleted first (e.g., free connectors in hierarchical element models).
List<EObject> deleteObjects = new ArrayList<EObject>();
List<EObject> disconnectObjects = new ArrayList<EObject>();
Set<EObject> targetSet = new HashSet<EObject>();
targetSet.addAll(targets);
......@@ -260,9 +264,21 @@ public class DeleteAction extends EObjectActionBase<EObject> {
for(EObject target : sortedTargets) {
if(IElementCompositorService.getInstance().canDecompose(target)) {
IElementCompositorService.getInstance().decompose(target);
deleteObjects.add(target);
} else if(IConnectionCompositorService.getInstance().canDisconnect(target)) {
IConnectionCompositorService.getInstance().disconnect(target);
disconnectObjects.add(target);
}
if(!deleteObjects.isEmpty()) {
for(int index = 0; index < deleteObjects.size(); index++) {
IElementCompositorService.getInstance().decompose(deleteObjects.get(index));
}
}
if(!disconnectObjects.isEmpty()) {
for(int index = 0; index < disconnectObjects.size(); index++) {
IElementCompositorService.getInstance().decompose(disconnectObjects.get(index));
}
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment