Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Get all written text out of the editor
Get all written text out of the editor [message #820752] Wed, 14 March 2012 14:26 Go to next message
Heinz Huber is currently offline Heinz HuberFriend
Messages: 45
Registered: February 2012
Member
Hi,

first of all ... i am sorry to have opened this topic!
But i can not remember the name of a function i found 2 weeks ago.

I was writing my formatter and searched for a way to access the grammer. Within this process i found a function which got me ALL things which i wrote (with comments, whitespaces ...) in the plugin's editor. After some time i found a better way to format and so i forgot this function.

Now i need it in another context ... could someone please tell me the name of this function? Searching this board and google doesn't help me remember. Playing with functions and classes which could be the right ones doesn't help either.

Thanks in advance for helping me remember ...

Re: Get all written text out of the editor [message #820755 is a reply to message #820752] Wed, 14 March 2012 14:30 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13416
Registered: July 2009
Senior Member
Are you talking about the NodeModelUtils class?

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Get all written text out of the editor [message #820760 is a reply to message #820755] Wed, 14 March 2012 14:36 Go to previous messageGo to next message
Heinz Huber is currently offline Heinz HuberFriend
Messages: 45
Registered: February 2012
Member
Hi Christian,

no i don't think, that the class was called like this.
It was something which i tried inside the configureFormatting() function inside my extended AbstractDeclarativeFormatter.
I think i found that way of accessing the grammar by using google (about 2 weeks ago) ... but now i'm not able to find the information again.

The function returned me all the text which was wrote inside the editor file.
With comments, whitespaces and all that stuff. I think the return value was a String, char[] ... something like that.

Don't really remember ... thats my problem Sad
Hope you got an idea after reading this!

If you know another function (maybe a function of a eclipse thing) which is doing the same -> Thats okay for me too!

[Updated on: Wed, 14 March 2012 14:38]

Report message to a moderator

Re: Get all written text out of the editor [message #820778 is a reply to message #820760] Wed, 14 March 2012 14:54 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13416
Registered: July 2009
Senior Member
Hi what is your desired starting point for that? What is the thing
you have in hands


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Get all written text out of the editor [message #820941 is a reply to message #820778] Wed, 14 March 2012 19:18 Go to previous messageGo to next message
Heinz Huber is currently offline Heinz HuberFriend
Messages: 45
Registered: February 2012
Member
What do you exactly mean with "starting point"?
I remember that i had a function which could do that inside the configureFormatting() function! I dont know which starting points i got there ... maybe something with grammarAccess, GrammarUtil whatever :A

But in thecontext i want to use it, is in the hoover effect class.
I want to walk through the document and search for a comment ... and then open this comment (which represents a file link) to get some information.
This information will then be shown in the hoover effect.

Not a very usual use case i know, but i want/need this Smile
Re: Get all written text out of the editor [message #820953 is a reply to message #820941] Wed, 14 March 2012 19:32 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13416
Registered: July 2009
Senior Member
Hi, I meant actually the context you want to use the functionality.
If you use nodemodelutils to get the node for your object you can ask
the node for its text.


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Get all written text out of the editor [message #821325 is a reply to message #820953] Thu, 15 March 2012 07:48 Go to previous message
Heinz Huber is currently offline Heinz HuberFriend
Messages: 45
Registered: February 2012
Member
Hi Christian,

i tried your way with the NodeModelUtils now. It works very well Smile
Thank's for your fast help!

If i remember the function i used before, i will note it here!

[Updated on: Thu, 15 March 2012 07:57]

Report message to a moderator

Previous Topic:Problem loading references before Eclipse clean
Next Topic:elementary - all steps required to use a mixin grammar
Goto Forum:
  


Current Time: Mon Mar 30 23:47:41 GMT 2020

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

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

Back to the top