Skip to main content



      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 13:36 Go to next message
Eclipse UserFriend
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] Tue, 08 March 2011 20:19 Go to previous messageGo to next message
Eclipse UserFriend
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 03:45 Go to previous message
Eclipse UserFriend
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 03:46] by Moderator

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


Current Time: Sat Jul 05 07:23:14 EDT 2025

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

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

Back to the top