Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Get selected element
Get selected element [message #1450709] Wed, 22 October 2014 20:44 Go to next message
Vinicius Souza is currently offline Vinicius SouzaFriend
Messages: 4
Registered: October 2014
Junior Member
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 08:34 Go to previous message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 482
Registered: July 2009
Location: Nantes, France
Senior Member
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

Join the Sirius community at SiriusCon. Register for free: Nov. 9th Paris
http://www.siriuscon.org/
Previous Topic:Export the Sirius project so others can use
Next Topic:Developer Documentation
Goto Forum:
  


Current Time: Sun Apr 05 08:23:17 GMT 2020

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

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

Back to the top