Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Change background color of in text editor selected words
Change background color of in text editor selected words [message #1007763] Thu, 07 February 2013 12:39 Go to next message
Ralph Gerbig is currently offline Ralph Gerbig
Messages: 697
Registered: November 2009
Senior Member
Hello,

I use the following code in a SelectionListener to change the background color of the word currently selected.

sourceViewer.getTextWidget().setStyleRange(new StyleRange(new TextStyle(null, black, grey)));


The problem is that nothing happens and no Exception is thrown. What do I miss here? Is there a other way to do it?

Ralph
Re: Change background color of in text editor selected words [message #1008173 is a reply to message #1007763] Mon, 11 February 2013 09:19 Go to previous message
Ralph Gerbig is currently offline Ralph Gerbig
Messages: 697
Registered: November 2009
Senior Member
Hi all,

I solved it by adding an Annotation of type org.eclipse.jdt.ui.occurrences to the word where the cursor is placed.

Ralph
Previous Topic:Is there a way to show welcome page in editor area?
Next Topic:Setting the image of a viewreference programmatically
Goto Forum:
  


Current Time: Sat Oct 25 05:50:44 GMT 2014

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

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