use of org.eclipse.emf.ecore.util.EcoreUtil.Copier in project Palladio-Editors-Sirius by PalladioSimulator.
the class PCMServices method copyEObject.
/**
* Copies an EObject
* @param eObject the EObject to be copied
* @return The copy
*/
public EObject copyEObject(EObject eObject) {
Copier copier = new Copier();
EObject copy = copier.copy(eObject);
copier.copyReferences();
return copy;
}
use of org.eclipse.emf.ecore.util.EcoreUtil.Copier in project InformationSystem by ObeoNetwork.
the class ImportData method initializeCopyElements.
private void initializeCopyElements() {
Collection<EObject> allObjects = new ArrayList<>();
allObjects.addAll(sourceSemanticRoots);
allObjects.addAll(sourceGraphicalRoots);
Copier copier = new Copier();
copier.copyAll(allObjects);
copier.copyReferences();
// Build the copy to source map
copyToSourceMap = new HashMap<EObject, EObject>();
for (EObject sourceRoot : sourceSemanticRoots) {
copyToSourceMap.put(copier.get(sourceRoot), sourceRoot);
}
// Save the copier as the source to copy map
sourceToCopyMap = copier;
}
use of org.eclipse.emf.ecore.util.EcoreUtil.Copier in project InformationSystem by ObeoNetwork.
the class ImportData method initializeCopyElements.
private void initializeCopyElements() {
Collection<EObject> sourceEObjects = new ArrayList<EObject>();
sourceEObjects.addAll(sourceRoots);
sourceEObjects.addAll(sourceRepresentationDescriptors);
for (DRepresentationDescriptor dRepresentationDescriptor : sourceRepresentationDescriptors) {
sourceEObjects.add(dRepresentationDescriptor.getRepresentation());
}
Copier copier = new Copier();
copier.copyAll(sourceEObjects);
copier.copyReferences();
// Build the copy to source map
copyToSourceMap = new HashMap<EObject, EObject>();
for (EObject sourceEObject : sourceEObjects) {
copyToSourceMap.put(copier.get(sourceEObject), sourceEObject);
}
// Save the copier as the source to copy map
sourceToCopyMap = copier;
}
Aggregations