Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Getting an IXtextDocument without open editor
Getting an IXtextDocument without open editor [message #1413082] Wed, 27 August 2014 14:44 Go to next message
Eclipse UserFriend
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 03:07 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Getting an IXtextDocument without open editor [message #1413268 is a reply to message #1413262] Thu, 28 August 2014 03:15 Go to previous messageGo to next message
Eclipse UserFriend
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 04:25 Go to previous messageGo to next message
Eclipse UserFriend
hmm then i fear i have no idea on this
Re: Getting an IXtextDocument without open editor [message #1413329 is a reply to message #1413295] Thu, 28 August 2014 05:34 Go to previous messageGo to next message
Eclipse UserFriend
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 05:34] by Moderator

Re: Getting an IXtextDocument without open editor [message #1413342 is a reply to message #1413329] Thu, 28 August 2014 06:00 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Getting an IXtextDocument without open editor [message #1413399 is a reply to message #1413342] Thu, 28 August 2014 08:37 Go to previous message
Eclipse UserFriend
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: Fri Jul 04 02:13:12 EDT 2025

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

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

Back to the top