Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Dynamic Syntax Highlighting
Dynamic Syntax Highlighting [message #1005843] Mon, 28 January 2013 18:46 Go to next message
Nathan M is currently offline Nathan M
Messages: 5
Registered: January 2013
Junior Member
Hi,

I'm wondering if it's possible to have some text in the editor get a certain TextStyle that isn't known until runtime.

For example, if in the editor the user types "#ffff00", I want the text to be yellow, if the user types "#ff0000" I want the text to be red, etc... Basically I don't know what the color of the text actually is until I have analyzed the user input.

Is there a way to do this?

[Updated on: Mon, 28 January 2013 20:26]

Report message to a moderator

Re: Dynamic Syntax Highlightinh [message #1005863 is a reply to message #1005843] Tue, 29 January 2013 01:14 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6137
Registered: July 2009
Senior Member
Yes this is possible. The term is semantic highlighting
http://www.eclipse.org/Xtext/documentation.html#highlighting

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de

[Updated on: Tue, 29 January 2013 01:24]

Report message to a moderator

Re: Dynamic Syntax Highlighting [message #1006716 is a reply to message #1005843] Fri, 01 February 2013 09:37 Go to previous message
Nathan M is currently offline Nathan M
Messages: 5
Registered: January 2013
Junior Member
True, but as far as I can tell, you must preregister the particular highlighting configurations. In other words, I don't see how you can dynamically change the color of some text based on the value of the text in the editor (not unless you predefined every possible color that can exist...)
Previous Topic:SAXParseException on running Maven build for test that builds an Xtext model
Next Topic:Get text from texteditor
Goto Forum:
  


Current Time: Tue Jul 29 00:38:21 EDT 2014

Powered by FUDForum. Page generated in 0.07039 seconds