Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Representing nodes from imported model
Representing nodes from imported model [message #1384822] Mon, 02 June 2014 11:07 Go to next message
Wilbert Alberts is currently offline Wilbert AlbertsFriend
Messages: 209
Registered: June 2010
Senior Member
Hi,

I've created two metamodels. One metamodel (called 'interfaces') allows definition of interfaces with their operations. The other metamodel (called 'components') allows the definition of components. A component might provide or require interfaces (as defined in the 'interfaces' metamodel).

Using EMFText, I have a textual editor for interfaces models. For components, I would like to realize a Sirius based graphical editor. It should allows the creation of components and associating them with interfaces (defined in other interface models). I'm not necesarily interested in the ability to edit interface models from the graphical editor.

I created an example consisting of a component and two interfaces. I succeed in visualising the component. However, I don't succeed in visualizing the associated interfaces. Is there something special to be done when model elements are originating from a different resource?

Any clue?

Greetings,
Wilbert.




Re: Representing nodes from imported model [message #1384825 is a reply to message #1384822] Mon, 02 June 2014 11:24 Go to previous messageGo to next message
Wilbert Alberts is currently offline Wilbert AlbertsFriend
Messages: 209
Registered: June 2010
Senior Member
Hi,

A quick follow up. What I want to achieve is similar to the 'add related elements' functionality of the nowadays standard graphical editor for ecore models. That one is also based on Sirius if I'm right.

Greetings,
Wilbert.
Re: Representing nodes from imported model [message #1384842 is a reply to message #1384822] Mon, 02 June 2014 13:29 Go to previous messageGo to next message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 516
Registered: July 2009
Location: Nantes, France
Senior Member
Le 02/06/2014 13:07, Wilbert Alberts a écrit :
> Hi,
Hi,
>
> I've created two metamodels. One metamodel (called 'interfaces') allows
> definition of interfaces with their operations. The other metamodel
> (called 'components') allows the definition of components. A component
> might provide or require interfaces (as defined in the 'interfaces'
> metamodel).
>
> Using EMFText, I have a textual editor for interfaces models. For
> components, I would like to realize a Sirius based graphical editor. It
> should allows the creation of components and associating them with
> interfaces (defined in other interface models). I'm not necesarily
> interested in the ability to edit interface models from the graphical
> editor.
>
> I created an example consisting of a component and two interfaces. I
> succeed in visualising the component. However, I don't succeed in
> visualizing the associated interfaces. Is there something special to be
> done when model elements are originating from a different resource?

It seems you should improve the semantic candidates expression of your
interface mapping. I see too possibilities: an empty expression (Sirius
should look into all semantic resources of the session for element which
are instances of the mapping's domain class), or create a Java service
to subtly retrieve the associated interface from the diagram/container
semantic element.

>
> Any clue?
>
> Greetings,
> Wilbert.
>
>
>
>
>


Maxime Porhel - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Representing nodes from imported model [message #1384844 is a reply to message #1384825] Mon, 02 June 2014 13:37 Go to previous message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 516
Registered: July 2009
Location: Nantes, France
Senior Member
Le 02/06/2014 13:24, Wilbert Alberts a écrit :
> Hi,
Hi,
>
> A quick follow up. What I want to achieve is similar to the 'add related
> elements' functionality of the nowadays standard graphical editor for
> ecore models. That one is also based on Sirius if I'm right.

Ecore Tools [1] is effectively based on Sirius. You should directly look
into its Git repository [2] to see how the 'add related elements' is
implemented.

See:
. the OperationAction named "Add Related Elements" in the odesign [3]
. the getRelated(views,diagram) service to retrieve the elements
(displayed in a wizard to let the user choose the element to add on the
diagram) [4]


>
> Greetings,
> Wilbert.
>


Regards,

Maxime

[1] https://www.eclipse.org/ecoretools/
[2] http://git.eclipse.org/c/ecoretools/org.eclipse.ecoretools.git
[3]
http://git.eclipse.org/c/ecoretools/org.eclipse.ecoretools.git/tree/org.eclipse.emf.ecoretools.design/description/ecore.odesign
[4]
http://git.eclipse.org/c/ecoretools/org.eclipse.ecoretools.git/tree/org.eclipse.emf.ecoretools.design/src/org/eclipse/emf/ecoretools/design/service/RelatedElementsSwitch.java


Maxime Porhel - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Drag&Drop without moving the Node ...
Next Topic:Sirius capabilities
Goto Forum:
  


Current Time: Fri Apr 26 18:34:28 GMT 2024

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

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

Back to the top