Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Getting an IXtextDocument without open editor
Getting an IXtextDocument without open editor [message #1413082] Wed, 27 August 2014 18:44 Go to next message
Daniel K. is currently offline Daniel K.Friend
Messages: 14
Registered: August 2014
Location: Stuttgart
Junior Member
Hi,
is it possible to retrieve a org.eclipse.xtext.ui.editor.model.IXtextDocument from a resource/file without an editor opened?
Most of the code I found was getting it from an opened editor.
Background:
We want to do some processing of Xtext files with probably the same code as it is used with the editor. The only difference is, that we want to load the files directly.
Is this possible in some way?

Regards
Daniel
Re: Getting an IXtextDocument without open editor [message #1413262 is a reply to message #1413082] Thu, 28 August 2014 07:07 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13264
Registered: July 2009
Senior Member
Hi,

can you be a bit more specific: what do you want to do with the files? do you actually need a xtext document or is the resource ok


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Getting an IXtextDocument without open editor [message #1413268 is a reply to message #1413262] Thu, 28 August 2014 07:15 Go to previous messageGo to next message
Daniel K. is currently offline Daniel K.Friend
Messages: 14
Registered: August 2014
Location: Stuttgart
Junior Member
Hi,
a normal Resource I can get using the ResourceSet...
As most of the code uses the xtext document it would be fine to be able to retrieve such one only using a URI or something similar.
The code I'm talking about is already existent and is performing some actions on it, mainly from commands.
We want to automate this.

Regards
Daniel
Re: Getting an IXtextDocument without open editor [message #1413295 is a reply to message #1413268] Thu, 28 August 2014 08:25 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13264
Registered: July 2009
Senior Member
hmm then i fear i have no idea on this

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Getting an IXtextDocument without open editor [message #1413329 is a reply to message #1413295] Thu, 28 August 2014 09:34 Go to previous messageGo to next message
Uli Merkel is currently offline Uli MerkelFriend
Messages: 246
Registered: June 2013
Senior Member
Hi Daniel, Christian.

IIRC,somewhere in this forum there was some info
about starting the generator from the context menue without saving the file before.

Perhaps this may give you some inspiration how to start your processing.

[Updated on: Thu, 28 August 2014 09:34]

Report message to a moderator

Re: Getting an IXtextDocument without open editor [message #1413342 is a reply to message #1413329] Thu, 28 August 2014 10:00 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13264
Registered: July 2009
Senior Member
Yes this was my post, but i do not use any xtextdocument. this is why i asked it a document is required 100% and i interpreted Daniels Answer as Yes

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Getting an IXtextDocument without open editor [message #1413399 is a reply to message #1413342] Thu, 28 August 2014 12:37 Go to previous message
Daniel K. is currently offline Daniel K.Friend
Messages: 14
Registered: August 2014
Location: Stuttgart
Junior Member
Hi,
I will try it without the xtextdocument.
I will need to shift some of the functionality.
It is good to know then, not to relate to it in the functionality itself, if it is such a problem to retrieve an instance of it.
Thanks for your help.

Regards
Daniel
Previous Topic:code generation using xtend
Next Topic:Default structure for new dsl file
Goto Forum:
  


Current Time: Mon Dec 09 15:51:05 GMT 2019

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

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

Back to the top