Hyperlinks? How do I add annotations to an editor? [message #259903] |
Thu, 08 July 2004 18:16 |
Eclipse User |
|
|
|
Originally posted by: dgreenfi.cs.umd.edu
I am trying to incorporate hyperlinked text in a text editor. Because I
want the hyperlinks to move as the text is edited, it seems like it makes
sense to use the annotation mechanism in the TextEditor.
I am trying to figure out how to programmaticaly add annotations to a text
file in an editor.
I also would need to control how the annotations appear - by changing the
color of the text and a straight underline.
I also need to be able to get the enclosing rectangle of the annotated
text so that I can handle mouseclicks.
The best I've been able to do so far is to use the DefaultRangeIndicator
subclass of Annotation, which only shows by highlighting the entire line
containing the annotation. It's not clear to me whether I should be
actually be creating a textmarker type of IMarker and then wrapping it in
a MarkerAnnotation. When I do this, the annotation does not show up at all.
Any advice on whether this is a good approach in general and on the
specifics of adding annotations and controlling their appearance and
behavior?
Thanks much,
David
|
|
|
Powered by
FUDForum. Page generated in 0.03641 seconds