Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Get model file location of current editing diagram
Get model file location of current editing diagram [message #1698955] Fri, 19 June 2015 07:35 Go to next message
Le Chau Nguyen is currently offline Le Chau NguyenFriend
Messages: 19
Registered: August 2012
Junior Member
Hi folks,

After having a model called club (club.ecore) and Sirius UI of it (club.odesign), I created a new Sirius model project then make a new model file inside by using "Example EMF Model Creation Wizards", let say the name is: example.club.
And I extend the Sirius Tab bar in diagram editor to have an addition button named "Check".
When click to "Check", I want to access to example.club to do some processing on this file.
Could you teach me how to get the file location of the model file under the Diagram?
When we change something in Diagram, the model file reflect according to the change. So Sirius handle the mapping between the diagram and the model file. But I can not find it yet, please help me. Sorry if it is naive question because I am Sirius newbie.

Regards,
Chau Nguyen
Re: Get model file location of current editing diagram [message #1699295 is a reply to message #1698955] Tue, 23 June 2015 09:31 Go to previous messageGo to next message
Laurent Fasani is currently offline Laurent FasaniFriend
Messages: 182
Registered: October 2014
Senior Member
Le 19/06/2015 09:35, Le Chau Nguyen a écrit :
> Hi folks,
Hello
>
> After having a model called club (club.ecore) and Sirius UI of it
> (club.odesign), I created a new Sirius model project then make a new
> model file inside by using "Example EMF Model Creation Wizards", let say
> the name is: example.club.
> And I extend the Sirius Tab bar in diagram editor to have an addition
> button named "Check".
> When click to "Check", I want to access to example.club to do some
> processing on this file.
> Could you teach me how to get the file location of the model file under
> the Diagram?

you can call
org.eclipse.sirius.business.api.query.EObjectQuery.getSession() to get
the session and then
org.eclipse.sirius.business.api.session.Session.getSemanticResources()

Once you get your semantic resources you can access the IFile. You may
refer to this post to handle it.
https://www.eclipse.org/forums/index.php/t/128695/

> When we change something in Diagram, the model file reflect according to
> the change. So Sirius handle the mapping between the diagram and the
> model file. But I can not find it yet, please help me. Sorry if it is
> naive question because I am Sirius newbie.
>
> Regards,
> Chau Nguyen
>
Regards
Laurent


Laurent Fasani - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Get model file location of current editing diagram [message #1699332 is a reply to message #1699295] Tue, 23 June 2015 12:40 Go to previous message
Le Chau Nguyen is currently offline Le Chau NguyenFriend
Messages: 19
Registered: August 2012
Junior Member
Thanks Laurent, that seems a clear way, I will try it.
Previous Topic:support individual styles based on domain classes for children inside the same ordered list inside a
Next Topic:How to call a Java service
Goto Forum:
  


Current Time: Thu Mar 28 18:03:08 GMT 2024

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

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

Back to the top