|
Re: Get selected element [message #1451037 is a reply to message #1450709] |
Thu, 23 October 2014 08:34 |
|
Hi,
Le 22/10/2014 22:44, Vinicius Souza a écrit :
> My issue seems to be very simple but I could not manage to solve it. How
> can I get the EMF object selected in a diagram?
I think it depends on the content of your selection.
If you try to use the interpreter view, the selection will contains the
Sirius internal EObjects, from them you can retrieve the corresponding
domain/semantic element with the "target" reference. This EReference is
define in the Sirius metamodel on the DSemanticDecorator EClass.
If you are in some Java code, the following tips could allow to retrieve
the wanted element:
. org.eclipse.gef.EditPart.getModel() will return the GMF View
. org.eclipse.gmf.runtime.notation.View.getElement() will return the
Sirius DDiagramElement
. org.eclipse.sirius.diagram.DDiagramElement inherits from
org.eclipse.sirius.viewpoint.DSemanticDecorator and getTarget() will
return the domain EObject.
Regards
--
Maxime - Obeo
Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Maxime Porhel - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
Powered by
FUDForum. Page generated in 0.03432 seconds