Skip to main content



      Home
Home » Eclipse Projects » Sirius » Get selected element
Get selected element [message #1450709] Wed, 22 October 2014 16:44 Go to next message
Eclipse UserFriend
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?
Re: Get selected element [message #1451037 is a reply to message #1450709] Thu, 23 October 2014 04:34 Go to previous message
Eclipse UserFriend
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
Previous Topic:Export the Sirius project so others can use
Next Topic:Developer Documentation
Goto Forum:
  


Current Time: Tue Jul 08 22:01:08 EDT 2025

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

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

Back to the top