Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [Formatting2] rendering Region
[Formatting2] rendering Region [message #1699653] Thu, 25 June 2015 14:40 Go to next message
aurel pestell is currently offline aurel pestellFriend
Messages: 90
Registered: October 2013
Location: Sweden
Member
Hi,

I remember there was a way to render a Region in the old formatter by
doing something like this:

String rendered = format.renderToString(myEObject.nodeForEObject.textRegion.offset,myEObject.nodeForEObject.textRegion.length)


Is it still possible to do that in the new formatter ? (2.8.2)

Thank you

Aurel
Re: [Formatting2] rendering Region [message #1699798 is a reply to message #1699653] Fri, 26 June 2015 16:43 Go to previous message
aurel pestell is currently offline aurel pestellFriend
Messages: 90
Registered: October 2013
Location: Sweden
Member

The only one way that works is to create a sub document from the current one, then format the element in question
along with that sub document.
Then get the text replacements using mySubDocument.renderToTextReplacements()
There you get enough information to see how things where replaced.
I just can't find a way to pass on the replacements to the parent document so I don't need to run the formatter twice on the same element.
But it works for now.
Previous Topic:Migration from 2.7.3 to 2.8.3
Next Topic:Bind JVM object reference to a grammar element
Goto Forum:
  


Current Time: Tue Mar 19 04:13:19 GMT 2024

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

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

Back to the top