Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Find ConnectionEditPart for corresponding EObject
Find ConnectionEditPart for corresponding EObject [message #488672] Tue, 29 September 2009 17:05 Go to next message
Hauke Fuhrmann is currently offline Hauke FuhrmannFriend
Messages: 333
Registered: July 2009
Senior Member
Dear GMF folks,

I have an EObject that is the model element of the view of an
ConnectionEditPart. How can I determine the EditPart for that EObject in
an active GMF editor?

For any other EditParts than connections this seems pretty simple:

DiagramEditor editor = ...
DiagramEditPart dep = editor.getDiagramEditPart();
EditPart editPart = dep.findEditPart(dep, eObject);

However, for connections this returns null, because a connection edit
part is not contained in any other edit part in the diagram. Although a
connection EP has a parent, this parent does not have this connection EP
as a child. Is this really desired behavior?? Seems a bit odd to me.

Any other way to search for a connection edit part? How could I obtain
all connection edit parts and iterate them manually?

Cheers,
Hauke
Re: Find ConnectionEditPart for corresponding EObject [message #489389 is a reply to message #488672] Fri, 02 October 2009 18:30 Go to previous message
Alex Shatalin is currently offline Alex ShatalinFriend
Messages: 141
Registered: July 2009
Senior Member
Hello Hauke,

See org.eclipse.gef.editparts.AbstractEditPart.registerModel() - any EditPart's
model will be registered there, so you can use:
getViewer().getEditPartRegistry().get(<view>) to access EditPart representing
link view.

-----------------
Alex Shatalin
Previous Topic:Preventing a node from being deleted
Next Topic:Connections not visible after duplicate action
Goto Forum:
  


Current Time: Wed Apr 24 18:09:37 GMT 2024

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

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

Back to the top