Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » AbstractDecoratedTextEditor Backgroundcolor
AbstractDecoratedTextEditor Backgroundcolor [message #781794] Sun, 22 January 2012 09:31 Go to next message
Jeff Doth is currently offline Jeff DothFriend
Messages: 10
Registered: January 2012
Junior Member
Hello,

my editor extends AbstractDecoratedTextEditor. I am trying to change the background color of a certain range in the document (like the Eclipse Debugger to highlight the current line). In StyledText I would simply use StyleRange but how can I do this in AbstractDecoratedTextEditor or TextEditor?

Thanks in advance!
Re: AbstractDecoratedTextEditor Backgroundcolor [message #782143 is a reply to message #781794] Mon, 23 January 2012 08:52 Go to previous message
Dani Megert is currently offline Dani MegertFriend
Messages: 3801
Registered: July 2009
Senior Member
On 22.01.2012 10:31, Jeff Doth wrote:
> Hello,
>
> my editor extends AbstractDecoratedTextEditor. I am trying to change
> the background color of a certain range in the document (like the
> Eclipse Debugger to highlight the current line). In StyledText I would
> simply use StyleRange but how can I do this in
> AbstractDecoratedTextEditor or TextEditor?
This is normally done by adding an annotation to the document (or more
precise: to its annotation model). You can then assign presentations to
your own annotation type, e.g. draw a background color. Take a look at
the following two extension points:

org.eclipse.ui.editors.annotationTypes
org.eclipse.ui.editors.markerAnnotationSpecification

If it's really just about drawing you might also want to try
org.eclipse.jface.text.ITextPresentationListener.

Dani
>
> Thanks in advance!
Previous Topic:Eclipse hotkey for the mouse double click?
Next Topic:flash builder plugin
Goto Forum:
  


Current Time: Thu Oct 18 17:36:04 GMT 2018

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

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

Back to the top