|
Re: How to get EObject from element graphic [message #1410439 is a reply to message #1410018] |
Wed, 20 August 2014 19:33 |
|
Le 19/08/2014 17:23, Dat Nguyen a écrit :
> Hi, i'm newbie. I have a question.
Hi.
> when i select a element in Sirius diagram, it return a instance of
> DDiagram, but i want to get instances of EObject. Is there any ways to
> get EObject from selection in Sirius Diagram?
All Sirius model elements which represent a semantic/domain element
implement the org.eclipse.sirius.viewpoint.DSemanticDecorator interface,
which provides the getTarget() method (actually an EMF EReference) to
access the underlying EObject.
This is the case for:
* all "top-level" representations (diagrams, which in practice are
instances of DSemanticDiagram that inherit from DDiagram; tables,
instances of DTable; and trees, instances of DTree);
* all the individual elements (DRepresentationElement) inside these
representations: DNodes/DContainer/DEdges/etc. in diagrams,
DLine/DColumn in tables, and DTreeItem in tree representations.
DRepresentationElement also provides getSemanticElements() to access the
"secondary" associated semantic elements, if any (the ones specified via
"Associated Elements Expressions" in the mapping definitions).
--
Pierre-Charles David - Obeo
Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Pierre-Charles David - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
Powered by
FUDForum. Page generated in 0.03851 seconds