Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to navigate in the workspace(where is the parsed text (and what name is it)?)
icon5.gif  How to navigate in the workspace [message #658502] Tue, 08 March 2011 18:36 Go to next message
Bodo is currently offline BodoFriend
Messages: 27
Registered: August 2010
Junior Member
I wonder how one can navigate in the workspace. How to get the location of the current workspace is clear, but where is the current parsed file located? I just want to generate output in a different folder as 'src' but with the same directory structure (similar to good old jave IDE).

Does any one know, how to get this information? BTW I use the validation class/object for output generation.

Bodo
Re: How to navigate in the workspace [message #658564 is a reply to message #658502] Wed, 09 March 2011 01:19 Go to previous messageGo to next message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
You can get the URI from the Resource, and you can get the Resource from
any contained object. The rest is standard Eclipse API for workspace,
projects and files (directly contained in project, linked, etc.).

- henrik

On 3/8/11 7:36 PM, Bodo wrote:
> I wonder how one can navigate in the workspace. How to get the location
> of the current workspace is clear, but where is the current parsed file
> located? I just want to generate output in a different folder as 'src'
> but with the same directory structure (similar to good old jave IDE).
>
> Does any one know, how to get this information? BTW I use the validation
> class/object for output generation.
>
> Bodo
Re: How to navigate in the workspace [message #658597 is a reply to message #658564] Wed, 09 March 2011 08:45 Go to previous message
Bodo is currently offline BodoFriend
Messages: 27
Registered: August 2010
Junior Member
Thanks alot.

Now I use:
System.out.println (model.eResource().getURI().path());
with model as root object.

what gives:
/resource/take.apart/src/ackermann.x

where

  • 'take.apart' is the project
  • 'src' is the folder
  • 'ackermann.x' is the file
  • 'resource' shall be the placeholder for the path of the workspace


That works fine! Smile

Bodo

[Updated on: Wed, 09 March 2011 08:46]

Report message to a moderator

Previous Topic:Howto integrate OCL in a grammar?
Next Topic:Strikethrough font style
Goto Forum:
  


Current Time: Wed Sep 25 02:26:11 GMT 2024

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

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

Back to the top