Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Get XtextResource from IProject(Get XtextResource from IProject)
Get XtextResource from IProject [message #1238161] Fri, 31 January 2014 14:58 Go to next message
Pawel Pogorzelski is currently offline Pawel PogorzelskiFriend
Messages: 40
Registered: July 2009
Member
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 14:58]

Report message to a moderator

Re: Get XtextResource from IProject [message #1238165 is a reply to message #1238161] Fri, 31 January 2014 15:07 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
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/


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Get XtextResource from IProject [message #1238171 is a reply to message #1238165] Fri, 31 January 2014 15:16 Go to previous messageGo to next message
Pawel Pogorzelski is currently offline Pawel PogorzelskiFriend
Messages: 40
Registered: July 2009
Member
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 15:18 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
What about triggering a Build on the project?

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Get XtextResource from IProject [message #1238182 is a reply to message #1238173] Fri, 31 January 2014 15:34 Go to previous messageGo to next message
Pawel Pogorzelski is currently offline Pawel PogorzelskiFriend
Messages: 40
Registered: July 2009
Member
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 15:36 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Have a Look at my blog. The Generator Works on the parsed file

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Get XtextResource from IProject [message #1238185 is a reply to message #1238184] Fri, 31 January 2014 15:39 Go to previous message
Pawel Pogorzelski is currently offline Pawel PogorzelskiFriend
Messages: 40
Registered: July 2009
Member
I will. Thanks Christian.

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


Current Time: Fri Apr 19 07:43:51 GMT 2024

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

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

Back to the top