Text highlighting in custom editor [message #198408] |
Thu, 08 March 2007 04:48  |
Eclipse User |
|
|
|
Originally posted by: boutter.ps.uni-sb.de
Hi folks,
I'm new to the group and I hope the question isn't arising every other day.
I've built my custom editor for a simulation language. Now when
simulating the code from the editor in a separate View, I want to
highlight the relevant parts of the code in the editor when selecting
something in the View.
The problem is I don't know how to do the highlight part (e.g. put some
color under the text or something like this, very similar to the mark
occurences feature of Eclipse). It seems that it can be done with
Annotations, but I didn't find anything on how to do it.
If someone could help me or point me to an article or a tutorial how to
do this I would be very thankful.
Regards,
Chris
|
|
|
Re: Text highlighting in custom editor [message #199032 is a reply to message #198408] |
Mon, 12 March 2007 10:10  |
Eclipse User |
|
|
|
Christophe Boutter wrote:
>Hi folks,
>
>I'm new to the group and I hope the question isn't arising every other day.
>
>I've built my custom editor for a simulation language. Now when
>simulating the code from the editor in a separate View, I want to
>highlight the relevant parts of the code in the editor when selecting
>something in the View.
>
>The problem is I don't know how to do the highlight part (e.g. put some
>color under the text or something like this, very similar to the mark
>occurences feature of Eclipse). It seems that it can be done with
>Annotations, but I didn't find anything on how to do it.
>
>
You need to register your annotation type using the
'org.eclipse.ui.editors.markerAnnotationSpecification' extension point.
Then you can simply add/remove the annotations from the annotation model
at will.
Dani
>If someone could help me or point me to an article or a tutorial how to
>do this I would be very thankful.
>
>Regards,
>Chris
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.08290 seconds