Skip to content
Snippets Groups Projects
Commit cbc4e46e authored by Sudeep Kanav's avatar Sudeep Kanav
Browse files

replace the objects in the clipboard with the pasted objects

refs 2360
parent cac128b5
No related branches found
No related tags found
No related merge requests found
......@@ -115,17 +115,23 @@ public class CopyPasteUtils {
}
EcoreUtil.Copier copier = new EcoreUtil.Copier();
BasicEList<EObject> copiedObjects = new BasicEList<EObject>();
for(EObject obj : getClipBoardContent()) {
EObject copy = copier.copy(obj);
adaptCopyNames(copy, target);
copier.copyReferences();
IElementCompositorService.INSTANCE.compose(target, copy, context);
copiedObjects.add(copy);
}
for(EObject obj : getClipBoardContent()) {
if(obj instanceof ISpeciallyCopyiable) {
((ISpeciallyCopyiable)obj).specialCopyHook(copier);
}
}
// Replacing the clipboard with the copied objects. The offset is expected to change
// recursively for multiple pasting of the same object. Following replaces the objects in
// the clipboard after being offset.
copyToClipboard(copiedObjects);
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment