Lines 208-214
Link Here
|
208 |
|
208 |
|
209 |
if (!parentRes.getURI().equals(sourceUri)) { |
209 |
if (!parentRes.getURI().equals(sourceUri)) { |
210 |
// don't need to check anything when pasting into the source |
210 |
// don't need to check anything when pasting into the source |
211 |
// resource (from which we cut in the first place) |
211 |
// resource (from which we cut in the first place). OK to |
|
|
212 |
// get all contents of 'toPaste' because the clipboard resource |
213 |
// has no cross-resource containment |
212 |
Iterator iter = EcoreUtil.getAllContents(Collections.singleton(toPaste)); |
214 |
Iterator iter = EcoreUtil.getAllContents(Collections.singleton(toPaste)); |
213 |
while (!result && iter.hasNext()) { |
215 |
while (!result && iter.hasNext()) { |
214 |
result = parentRes.getEObject( |
216 |
result = parentRes.getEObject( |
Lines 260-265
Link Here
|
260 |
EObject eObj = (EObject) it.next(); |
262 |
EObject eObj = (EObject) it.next(); |
261 |
if ((eObj instanceof EAnnotation) == false) { |
263 |
if ((eObj instanceof EAnnotation) == false) { |
262 |
resolveLocalProxies(eObj); |
264 |
resolveLocalProxies(eObj); |
|
|
265 |
|
266 |
// OK to get all contents of 'eObj' because the clipboard resource |
267 |
// has no cross-resource containment |
263 |
Iterator contentIt = eObj.eAllContents(); |
268 |
Iterator contentIt = eObj.eAllContents(); |
264 |
while (contentIt.hasNext()) { |
269 |
while (contentIt.hasNext()) { |
265 |
resolveLocalProxies((EObject) contentIt.next()); |
270 |
resolveLocalProxies((EObject) contentIt.next()); |
Lines 365-370
Link Here
|
365 |
|
370 |
|
366 |
private void fireCreateEvents() { |
371 |
private void fireCreateEvents() { |
367 |
List elements = new ArrayList(); |
372 |
List elements = new ArrayList(); |
|
|
373 |
|
374 |
// OK to get all contents because the elements were all pasted into |
375 |
// a single resource (no cross-resource containments) |
368 |
Iterator it = EcoreUtil.getAllContents(getPastedElementSet()); |
376 |
Iterator it = EcoreUtil.getAllContents(getPastedElementSet()); |
369 |
while (it.hasNext()) { |
377 |
while (it.hasNext()) { |
370 |
elements.add(it.next()); |
378 |
elements.add(it.next()); |
Lines 410-415
Link Here
|
410 |
.getPastedElement(); |
418 |
.getPastedElement(); |
411 |
if (getPastedElementSet().contains(pastedChildElement)) { |
419 |
if (getPastedElementSet().contains(pastedChildElement)) { |
412 |
recycleObjectId(pastedChildElement); |
420 |
recycleObjectId(pastedChildElement); |
|
|
421 |
|
422 |
// OK to get all contents of 'pastedChildElement' because we |
423 |
// paste all elements into the same resource (no |
424 |
// cross-resource containment) |
413 |
TreeIterator contentIt = pastedChildElement.eAllContents(); |
425 |
TreeIterator contentIt = pastedChildElement.eAllContents(); |
414 |
while (contentIt.hasNext()) { |
426 |
while (contentIt.hasNext()) { |
415 |
recycleObjectId((EObject) contentIt.next()); |
427 |
recycleObjectId((EObject) contentIt.next()); |
Lines 461-466
Link Here
|
461 |
pastedEObject = (EObject) it.next(); |
473 |
pastedEObject = (EObject) it.next(); |
462 |
checkReferences(pastedEObject); |
474 |
checkReferences(pastedEObject); |
463 |
//now, resolveReferences for contained elements recursively |
475 |
//now, resolveReferences for contained elements recursively |
|
|
476 |
// OK to get all contents of 'pastedEObject' because we |
477 |
// paste all elements into the same resource (no |
478 |
// cross-resource containment) |
464 |
TreeIterator contentIt = pastedEObject.eAllContents(); |
479 |
TreeIterator contentIt = pastedEObject.eAllContents(); |
465 |
while (contentIt.hasNext()) { |
480 |
while (contentIt.hasNext()) { |
466 |
checkReferences((EObject) contentIt.next()); |
481 |
checkReferences((EObject) contentIt.next()); |