Skip to main content


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 23:46 Go to next message
Nathan M is currently offline Nathan MFriend
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: Tue, 29 January 2013 01:26]

Report message to a moderator

Re: Dynamic Syntax Highlightinh [message #1005863 is a reply to message #1005843] Tue, 29 January 2013 06:14 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
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


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

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

Report message to a moderator

Re: Dynamic Syntax Highlighting [message #1006716 is a reply to message #1005843] Fri, 01 February 2013 14:37 Go to previous message
Nathan M is currently offline Nathan MFriend
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:Resource.save output is invalid XMI file
Next Topic:Get text from texteditor
Goto Forum:
  


Current Time: Fri Apr 19 22:00:24 GMT 2024

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

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

Back to the top