Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » writing to IXtextDocument(writing to IXtextDocument)
writing to IXtextDocument [message #1006523] Thu, 31 January 2013 15:00 Go to next message
Dana Klein is currently offline Dana Klein
Messages: 63
Registered: October 2012
Member
I have I Xtext Document (eclipse editor) and i want to write to it a new value.
i can read the xtext node (ILeaf Node) but i don't know how to write to it.
Re: writing to IXtextDocument [message #1006530 is a reply to message #1006523] Thu, 31 January 2013 15:22 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian Zarnekow
Messages: 2908
Registered: July 2009
Senior Member
Am 31.01.13 16:00, schrieb Dana Klein:
> I have I Xtext Document (eclipse editor) and i want to write to it a new
> value. i can read the xtext node (ILeaf Node) but i don't know how to
> write to it.

You can set the text of the document. The node model cannot be modified.
The text change in the document will trigger a reparse.

Regards,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Go visit: http://xtext.itemis.com
Re: writing to IXtextDocument [message #1006535 is a reply to message #1006530] Thu, 31 January 2013 15:41 Go to previous messageGo to next message
Dana Klein is currently offline Dana Klein
Messages: 63
Registered: October 2012
Member
i figured that as it doesn't have any setters but how can i edit the document? i want to do it in the code and not in the editor..
like the ProposalProvider that allow me to add code to the document
Re: writing to IXtextDocument [message #1006812 is a reply to message #1006535] Sat, 02 February 2013 10:30 Go to previous message
Jan Koehnlein is currently offline Jan Koehnlein
Messages: 656
Registered: July 2009
Senior Member
What's wrong with IDocument.set() and IDocument.replace() ?


Am 31.01.13 16:41, schrieb Dana Klein:
> i figured that as it doesn't have any setters but how can i edit the
> document? i want to do it in the code and not in the editor.. like the
> ProposalProvider that allow me to add code to the document


--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Previous Topic:Get text from texteditor
Next Topic:How to turn an expression String into an Xtext object?
Goto Forum:
  


Current Time: Sat Oct 25 11:20:38 GMT 2014

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

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