|
Re: Default copy/paste behaviour is overridden [message #1833657 is a reply to message #1833216] |
Tue, 20 October 2020 13:46 |
|
Hello,
If you copy multiple elements and paste them in a diagram with a paste tool, this tool will be called for each copied element one by one, that will be available in the "copiedElement" variable.
If you intend to copy different types of elements (as in different EClasses from your metamodel), I think it will be easier to have your tool call a service where the type of the argument is EObject. This way in your service, you will be able to handle any kind of copied element and process them as you need. So basically, you first need a model operation "Change context var:copiedElement" and an inner operation that call your service. I did a quick test with a sub operation "Change Context service:test()" and in my service class I have a method with the signature "public void test(EObject container) ". The first argument is always the context. If you want to also use the container variable in the service, you can add it to the arguments.
Best regards,
Steve
Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
Powered by
FUDForum. Page generated in 0.03432 seconds