Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Problem: Pasting Non Containment References when withInverseElist is true.
Problem: Pasting Non Containment References when withInverseElist is true. [message #425619] Wed, 03 December 2008 13:34 Go to next message
Robert Moloney is currently offline Robert MoloneyFriend
Messages: 14
Registered: July 2009
Junior Member
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


--
Re: Problem: Pasting Non Containment References when withInverseElist is true. [message #425621 is a reply to message #425619] Wed, 03 December 2008 13:49 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.zeligsoft.com

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
>
>
Previous Topic:XPAth Syntax - /@defines.1/@defines....
Next Topic:ChildCreationExtenderManager and Inherited Extensible models
Goto Forum:
  


Current Time: Thu Feb 27 08:55:36 GMT 2020

Powered by FUDForum. Page generated in 0.01729 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top