| [news.eclipse.modeling.gmt] Re: [Epsilon]cloning a model element in EOL |
1. create a new element e.g. B := new TypeOfA;
3. move B in the container of choice.
Thanks, Kimon
Hi Kimon,
Thanks for submitting https://bugs.eclipse.org/bugs/show_bug.cgi?id=246352
I'll look into it shortly.
Cheers, Dimitris
Dimitrios Kolovos wrote:Hi Kimon,
There is currently no built-in operation for copying model elements in EOL; however this seems to be a useful addition. Could you please open a feature request in the bugzilla?
As a temporary workaround you can use the (static) EcoreUtil.copy(EObject eObject) method which does exactly that. You'll need to create a new Epsilon tool and add a copy(EObject) operation that delegates to the respective operation of the EcoreUtil class.
Cheers, Dimitris
Kimon Polychroniadis wrote:Hi,
I am trying to copy an element of my model in another container in the model. For example I got element A in container C1 and I want to make a copy of A (e.g. B) in another container (e.g. C2). So the goal is to have A in C1 and B in C2, wiht A and B being identical.
However, I noticed that the ':= ' operator moves the object rather
copying it. I also thought of using the clone() command, manipulating the element as a Collection, no result. Is there a more rational way of doing this?
Thank you in advance, Kimon