|
|
|
Re: Working with a container to group model elements by dragging [message #1744570 is a reply to message #1744556] |
Wed, 28 September 2016 08:33   |
Eclipse User |
|
|
|
Hi Steve,
thanks for you answer.
Steve Monnier wrote on Wed, 28 September 2016 09:09
For the infinite containment, you need to reuse the same container mapping in the Import tab (also see the "Reuse mappings" part in the blogpost by Melanie). Then to be able to drag and drop a container from one parent to another, you will need to add a "Container Drop" tool (available among the "New Element Edition" in the contextual menus) otherwise you will only be able to move around a container without being able to change its parent. In this tool, you first add a "change context" operation and set it as "var:element". Then add a "move" operation and set it as "var:newSemanticContainer". This will move the drag container into the targeted container.
That is basically what I did before. I changed it in exact the way you proposed, but unfortunately I still have these two views which are mirroring each other. So maybe the problem is not the container drop itself. How is a container drop handled internally by Sirius? - I can imagine that a new container is created while the old one is deleted?
I am asking because I got the case, when a new instance of Group is created, I do the following things:
- change context to feature:eContainer
-- create Instance Group with reference name: modelelements
--- change context var:newlyCreatedGroup
---- move with new container expression: var:container and feature name: groupElements
I feel I need to do it that way, because I need the reference name to be set in my root class Model. Maybe my problem has anything to do with that?
Quote:About your metamodel, are you sure that you need the metaclass group? If ModelElement had a containment reference on itself, you could create a ModelElement and later add ModelElement in it without having to create a group. Then SpecialElement and VerySpecialElement would not be needed anymore.
Thanks for the hint. I already thought about that, but unfortunately this excerpt is not representing my whole model. The rest of it requires to have a Group metaclass...
Maybe you got some ideas on that... I got this feeling that a working solution is not far anymore.
Thanks!
Best
Alex
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06190 seconds