Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to get access to the current project location?
How to get access to the current project location? [message #876921] Fri, 25 May 2012 14:28 Go to next message
kisito Missing name is currently offline kisito Missing nameFriend
Messages: 16
Registered: November 2011
Junior Member
Hi all

I use Xtext and a JvmModelInfer.Xtend to generate java file. My generated java file is "c:/topfolder/my.project/src-gen/manager/Customer.java" and after the generation of this file, i would like to add information into this file:
"c:/topfolder/my.project/src-gen/manager/Order.java"
to achieve this, i must get the project folder name: "c:/topfolder/my.project" from my JvmModelInfer.Xtend code and i don't know how to do that. Please Help me
Thank
Re: How to get access to the current project location? [message #876983 is a reply to message #876921] Fri, 25 May 2012 16:12 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3108
Registered: July 2009
Senior Member
The project name is part of the resource URI
(platform:/resource/yourProjectName/src ..).

What kind of information do you want to add?

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 25.05.12 16:28, schrieb kisito Mising name:
> Hi all
>
> I use Xtext and a JvmModelInfer.Xtend to generate java file. My
> generated java file is
> "c:/topfolder/my.project/src-gen/manager/Customer.java" and after the
> generation of this file, i would like to add information into this file:
> "c:/topfolder/my.project/src-gen/manager/Order.java"
> to achieve this, i must get the project folder name:
> "c:/topfolder/my.project" from my JvmModelInfer.Xtend code and i don't
> know how to do that. Please Help me
> Thank
Re: How to get access to the current project location? [message #876988 is a reply to message #876983] Fri, 25 May 2012 16:33 Go to previous message
kisito Missing name is currently offline kisito Missing nameFriend
Messages: 16
Registered: November 2011
Junior Member
Thank Sebastian

I think, the ressource uri is relative to platform scheme. But i don't know if it's possible to get a java.io.File object using a platform scheme or using a org.eclipse.emf.common.util.URI object.
I want to add or update class members into an existing java file
Best Regard
Previous Topic:Possible leak in SortOutlineContribution
Next Topic:Case sensitivity control
Goto Forum:
  


Current Time: Mon Nov 30 18:29:38 GMT 2020

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

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

Back to the top