[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.gmf] Re: Problem: Pasting Non Containment References when withInverseElist is true.

Hi, Robert,

This is a question for the GMF newsgroup, so I copy my reply, there.

This looks like GMF fixed a bug in the Ganymede release. Bidirectional associations, generally, should not be copied and pasted because that will cause the referenced objects to be modified, acquiring references to the newly pasted objects. Usually, one expects only the object into which the paste is to be performed to have any changes. Anything else is surprising to the user.

Of course, your application may have a special need in this case. I'm not sure whether the API allows you to provide an override of the PasteIntoParentOperation to customize this behaviour. Hopefully, someone more knowledgeable in GMF can help you with that ...

Cheers,

Christian

Robert Moloney wrote:
Hi,

I recently upgraded to Ganymede from Europa. Copy and paste in my GMF
editor doesn't behave the same anymore.

The copied object has a non containment reference to another model's
object.
The list, the object is contained within is a
EObjectWithInverseResolvingEList.
In Ganymede the code below removes the object from the list of objects
to be pasted.

PasteIntoParentOperation:
private void resolveLocalProxies(EObject eObject) {
...
					boolean withInverseElist = (collection instanceof
EObjectWithInverseEList);
...
							} else if (withInverseElist) {
								collection.remove(eObj);
							}
						...
			}
		}
	}

In Europa the reference was not removed from the list of objects to be
pasted.

Can I get the code to return to the original behaviour?

Cheers

Rob