Adding Squiggle lines to text [message #147511] |
Tue, 21 October 2003 19:35  |
Eclipse User |
|
|
|
Originally posted by: btcoxx.cs.wm.edu
Hi,
I'm trying to write a plugin that will put squiggle lines under certain
Positions of text and am having difficulty deciphering the documentation. I
gather that I need to get the AnnotationModel from the document provider. I
then need to call addAnnotation(Annotation annotation,Position position).
If I'm on the right track so far, I'm having trouble figuring out which
annotation I should put as the parameter to addAnnotation. If I need to
create a new instance of one of its subclasses, which one and how do I
configure it. If I need to pass in an annotation that already exists
somewhere, where is it?
If I'm talking gibberish, I apologize. Please point me in the right
direction.
Thanks in Advance
-Ben
|
|
|
|
|
Re: Adding Squiggle lines to text [message #149127 is a reply to message #148864] |
Fri, 24 October 2003 12:26  |
Eclipse User |
|
|
|
Originally posted by: eclipse.tkilla.ch
J Myron Smith wrote:
> I've been watching this thread for several days in hopes that more
> information would be added. I've implemented an editor extended from
> TextEditor and have succeded in providing problem markers / annotations when
> syntax errors are detected when running my parser/compiler. The problem
> markers appear in the left margin sidebar and in the tasklist. I was hoping
> I would also get little red squigglies underlining the first character of
> the errant text and possibly a problem marker indicator on the tab of the
> file. This is not the case. To get the functionality I've gotten thus far, I
> didn't have to implement my own markers or anntotations.
Markers (something you can attach to a IResource) are shown as
annotations in the UI. If you want persistence, then Markers are what
you want. If you want just some temporary Annotation, you're better off
defining your own.
Note that the Marker / Annotation dependency is not always so clear and
will likely undergo some changes in the future.
> 1) what do I need to do to get the squiggly underline to appear in the
> text area?
Only marker types / annotations configured for display (see the
markerAnnotationSpecification extension point) are displayed. Use one of
the types defined or add your own extension.
> 2) what do I need to do to get a problem indicator to appear on the
> filename tab?
This is quite independent. See JavaEditorErrorTickUpdater for an example.
> 3) what is required to add popup characteristics to the annotations /
> markers to display a text popup when the mouse cursor is passed over them?
Yet another story. For example, see how TextViewerHoverManager fires up
text hovers (when hovering over the concerned text in the editor) or
AnnotationBarHoverManager for hovers over the vertical ruler (left hand
margin).
Hope this gives you some starting points, Tom
|
|
|
Powered by
FUDForum. Page generated in 0.03190 seconds