Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » get path of the active project
get path of the active project [message #1700245] Wed, 01 July 2015 07:40 Go to next message
roman stingler is currently offline roman stinglerFriend
Messages: 8
Registered: November 2014
Junior Member
I have some xml files from which information for the proposal provider is used.
Therefore, i have written a node listing file which readds the xml file.

But I had to hard code the path to the xml file.

File directory = workspace.getRoot().getLocation().toFile();
String path = directory.getPath() + "\\dslTest\\xml_file.xml";


the xml parsing file is located at org.xtext.example.mydsl
and the xml file is located within each project of the eclipse instance.

From the path above dslTest is the project name.
But i want to fetch this information automatically, because I want multiple projects with different xml files.

thanks
Re: get path of the active project [message #1700246 is a reply to message #1700245] Wed, 01 July 2015 07:44 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi,

you can have a look at the uri of the current model


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: get path of the active project [message #1700251 is a reply to message #1700246] Wed, 01 July 2015 08:25 Go to previous messageGo to next message
roman stingler is currently offline roman stinglerFriend
Messages: 8
Registered: November 2014
Junior Member
any hint?
I'm sorry, having a bad day
Re: get path of the active project [message #1700253 is a reply to message #1700251] Wed, 01 July 2015 09:18 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
somewere in your code you have an eobject in your hand

eobject.eResource().getURI()


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
[solved] Re: get path of the active project [message #1700341 is a reply to message #1700253] Thu, 02 July 2015 04:31 Go to previous message
roman stingler is currently offline roman stinglerFriend
Messages: 8
Registered: November 2014
Junior Member
Christian vielen dank nochmal

thank you so much
Previous Topic:Adding feature during post-processing
Next Topic:Combining Importing scope and a local scope
Goto Forum:
  


Current Time: Tue Mar 19 11:42:10 GMT 2024

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

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

Back to the top