Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Dynamic Syntax Highlighting
Dynamic Syntax Highlighting [message #1005843] Mon, 28 January 2013 18:46 Go to next message
Eclipse UserFriend
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] by 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
Eclipse UserFriend
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] by Moderator

Re: Dynamic Syntax Highlighting [message #1006716 is a reply to message #1005843] Fri, 01 February 2013 09:37 Go to previous message
Eclipse UserFriend
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: Thu Jul 24 15:37:59 EDT 2025

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

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

Back to the top