Skip to main content



      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 03:35 Go to next message
Eclipse UserFriend
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 05:31 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Get model file location of current editing diagram [message #1699332 is a reply to message #1699295] Tue, 23 June 2015 08:40 Go to previous message
Eclipse UserFriend
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: Mon Jul 07 15:39:54 EDT 2025

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

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

Back to the top