How to get EditPart of semantic element [message #557872] |
Thu, 09 September 2010 06:02  |
Eclipse User |
|
|
|
Hi,
how can I get the EditPart of a semantic element? For example a Class or a Port?
Is there a tutorial that explains how to create EditPart programmatically from newly created semantic elements and then show them in the editor?
Thanks in advance, star123
|
|
|
|
|
|
Re: How to get EditPart of semantic element [message #636106 is a reply to message #557872] |
Fri, 29 October 2010 06:31  |
Eclipse User |
|
|
|
On 09.09.10 12:02, 123star wrote:
> how can I get the EditPart of a semantic element? For example a Class or
> a Port?
If your EditParts are created with the edit part factory, you can use
org.eclipse.gef.EditPartViewer.getEditPartRegistry()
This is pure GEF. Since you mention "semantic model", I'm not sure
whether you may refer to GMF? In that case, there are two models: a
semantic (or domain) model and the notation (or graphical model). The
latter one is the model of the edit part, while the first one is
associated with the notation model. GMF provides a mechanism for that
matter, just have a look at
org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramGraphicalVi ewer.findEditPartsForElement(String,
Class)
If you cannot use the edit part registry nor GMF's mechanism, you may
want to use a ReverseLookupManager I've written for GEF3D. You'll find
that in the SVN at
https://dev.eclipse.org/svnroot/technology/org.eclipse.gef3d /trunk/org.eclipse.gef3d.ext/src/java/org/eclipse/gef3d/ext/ reverselookup/
Cheers,
Jens
|
|
|
Powered by
FUDForum. Page generated in 0.26363 seconds