Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Get XtextResource from IProject(Get XtextResource from IProject)
Get XtextResource from IProject [message #1238161] Fri, 31 January 2014 09:58 Go to next message
Eclipse UserFriend
How to get XtextResource from IProject with Xtext builder attached to it? I need to access the model for a file not open in an editor.

Seems trivial but I've been looking for some time with no luck.

Cheers,
Pawel

[Updated on: Fri, 31 January 2014 09:58] by Moderator

Re: Get XtextResource from IProject [message #1238165 is a reply to message #1238161] Fri, 31 January 2014 10:07 Go to previous messageGo to next message
Eclipse UserFriend
Hi can you please elaborate on your usecase. Maybe something like
http://christiandietrich.wordpress.com/2011/10/15/xtext-calling-the-generator-from-a-context-menu/
Re: Get XtextResource from IProject [message #1238171 is a reply to message #1238165] Fri, 31 January 2014 10:16 Go to previous messageGo to next message
Eclipse UserFriend
Christian,
I got an SVN pre-commit client-side hook to reject unwanted commits. The hook has to run a few checks against the model.

Thanks,
Paweł
Re: Get XtextResource from IProject [message #1238173 is a reply to message #1238171] Fri, 31 January 2014 10:18 Go to previous messageGo to next message
Eclipse UserFriend
What about triggering a Build on the project?
Re: Get XtextResource from IProject [message #1238182 is a reply to message #1238173] Fri, 31 January 2014 10:34 Go to previous messageGo to next message
Eclipse UserFriend
Isn't it possible to simply run a parser on IFile? I don't care about cross-references. Triggering a build looks too expensive since most of the time only small subset of files will be committed.
Re: Get XtextResource from IProject [message #1238184 is a reply to message #1238182] Fri, 31 January 2014 10:36 Go to previous messageGo to next message
Eclipse UserFriend
Have a Look at my blog. The Generator Works on the parsed file
Re: Get XtextResource from IProject [message #1238185 is a reply to message #1238184] Fri, 31 January 2014 10:39 Go to previous message
Eclipse UserFriend
I will. Thanks Christian.

Paweł
Previous Topic:UML-Profile -> Xtext Grammar
Next Topic:Problems xText - RCP integration
Goto Forum:
  


Current Time: Wed Jul 16 18:13:17 EDT 2025

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

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

Back to the top