Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [Highlighting] override text style
[Highlighting] override text style [message #1751186] Thu, 05 January 2017 13:38 Go to next message
aurel pestell is currently offline aurel pestellFriend
Messages: 90
Registered: October 2013
Location: Sweden
Member
Hi,

Is there a way to override a style of a text range that was already styled?
If I use that in my highlight configuration:
TextStyle textStyle = defaultTextStyle().copy();

then it loses all the previous colour syntaxing and so on.

What I am trying to do is to modify the background color of a feature while preserving its syntax colour.

Thanks for the help
Aurel

[Updated on: Thu, 05 January 2017 14:08]

Report message to a moderator

Re: [Highlighting] override text style [message #1751202 is a reply to message #1751186] Thu, 05 January 2017 15:37 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 10597
Registered: July 2009
Senior Member
i dont know a way to do this besides doing the cartesian product of the default and your highlighting
Re: [Highlighting] override text style [message #1751203 is a reply to message #1751202] Thu, 05 January 2017 15:43 Go to previous messageGo to next message
aurel pestell is currently offline aurel pestellFriend
Messages: 90
Registered: October 2013
Location: Sweden
Member
You mean something similar to what is said below?
https://github.com/mn-mikke/Model-driven-Pretty-Printer-for-Xtext-Framework/wiki/Standard-Way-of-Syntax-Highlighting-in-Xtext-Framework
Quote:
Although, the implementation of the IHighlightingConfiguration interface is a good possibility how to add new text styles, all default text styles are lost with this option. The possible solution how to preserve the default styles is to extend the DefaultHighlightingConfiguration class already implementing the interface and override the configure method to add new text styles. In order not to lose all default text styles, method's implementation has to contain call of the ancestor's implementation.


Re: [Highlighting] override text style [message #1751206 is a reply to message #1751203] Thu, 05 January 2017 16:08 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 10597
Registered: July 2009
Senior Member
exactly
Previous Topic:Combining Xtext with a MySQL database
Next Topic:function call operator?
Goto Forum:
  


Current Time: Mon May 29 22:55:24 GMT 2017

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

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