Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Refer to another file from the model's folder
Refer to another file from the model's folder [message #1760904] Thu, 04 May 2017 08:23 Go to next message
Cyril Osdoit is currently offline Cyril OsdoitFriend
Messages: 23
Registered: March 2017
Junior Member
Hello,
I would like to read a file from the same folder as the model and the representation file, Is there a way I can get either's path form Service.java or an external java file so I can add a button on my *.odesign to load it ?

Thank you
Re: Refer to another file from the model's folder [message #1760934 is a reply to message #1760904] Thu, 04 May 2017 12:37 Go to previous messageGo to next message
Laurent Redor is currently offline Laurent RedorFriend
Messages: 300
Registered: July 2009
Senior Member
Hi,

I'm not sure to understand everything. But if your service receives a semantic EObject as parameter, to have an IFile from it, you can use something like (not tested):
ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(EcoreUtil.getURI(semanticParameter).toPlatformResourceString(true))).getProject().getFile(specificPath)

Regards,

Laurent


Laurent Redor - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Refer to another file from the model's folder [message #1760940 is a reply to message #1760934] Thu, 04 May 2017 13:17 Go to previous message
Cyril Osdoit is currently offline Cyril OsdoitFriend
Messages: 23
Registered: March 2017
Junior Member
Seems to be working, thanks a lot
Previous Topic:using model types in Services.java
Next Topic:Cross table
Goto Forum:
  


Current Time: Fri Apr 26 13:15:55 GMT 2024

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

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

Back to the top