Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » AbstractDecoratedTextEditor Backgroundcolor
AbstractDecoratedTextEditor Backgroundcolor [message #781794] Sun, 22 January 2012 04:31 Go to next message
Eclipse UserFriend
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 03:52 Go to previous message
Eclipse UserFriend
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: Sun Aug 31 14:02:57 EDT 2025

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

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

Back to the top