Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Remove dangling references when link is deleted(Link has children elements that still are referenced by model elements.)
Remove dangling references when link is deleted [message #1232794] Fri, 17 January 2014 19:07 Go to next message
Ricardo CaWal is currently offline Ricardo CaWalFriend
Messages: 21
Registered: January 2013
Junior Member
Hello!

When deleting a link in the diagram, how can I remove all the references to the instance represented by the link and all the references to other instances that the link have as its containment?

I'm facing this problem: I have a instance that interconnects nodes in the diagram and that is represented by the link. This instance have is a container of other elements that are created when the link is created. Those elements have bidirectional properties that are setted to point to the nodes the link interconnect. These initialization are done with Feature Seq Initializer / Reference New Element Spec / Value Specification of the GMFMap model.

I'd modified ???ReorientCommand.reorientSource() / ???ReorientCommand.reorientTarget() to keep the bidirectional references of the children elements updated when I reorient the link and it's working. But when deleting the link in the diagram, the references to the children elements are not removed of the nodes. So, it happens to leaves the model with dangling references (since those children are not contained by the abstract containment tree and still are referenced in the model) and the user has to remove all the references to the children himself.

How I can tackle this problem and remove all the references to the children from the model when I delete the link? (I thought that GMF/EMF automatically would remove all those references as it's default behaviour...)

Thank you!
Re: Remove dangling references when link is deleted [message #1233989 is a reply to message #1232794] Tue, 21 January 2014 01:03 Go to previous message
Ricardo CaWal is currently offline Ricardo CaWalFriend
Messages: 21
Registered: January 2013
Junior Member
Please, does anyone can help with it?

I need to remove a element of the model (and also remove all children of this element) when removing a link in the diagram. When I select the link and press delete the element that represents the link is correctly removed from its container, but references to the containing elements aren't removed from other objects of the diagram. "Where I need to write code" / "what code i need to write" to resolve this issue?
Previous Topic:How to get the diagram programatically
Next Topic:SecurityException on invoking ViewService.createDiagram in a standalone project
Goto Forum:
  


Current Time: Fri Dec 19 16:47:04 GMT 2014

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

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