Moving from VerticalRuler to CompositeRuler, annotations lost [message #333660] |
Sun, 21 December 2008 21:48 |
Bret Schuhmacher Messages: 26 Registered: July 2009 |
Junior Member |
|
|
Hi all - I've spent days trying various things, doing research, etc. and
I'm no closer to a solution.
I've got a subclass of SourceViewer that originally created a
VerticalRuler and showed annotations properly.
I took that code and replaced the VerticalRuler with a CompositeRuler and
added an AnnotationRulerColumn and a LineNumberRulerColumn. I also added
an OverviewRuler. All rulers show, but the AnnotationRulerColumn doesn't
show any annotations, although I've got styled text in the document (i.e.
squigglys underlining text). The OverviewRuler shows, but is also empty;
I'm not worried about it at the moment...
Do you have to manually do more when you try to hook in an
AnnotationRulerColumn vs. a VerticalRuler? Do you have to fully populate
the AnnotationModel *before* connecting it to an AnnotationRulerColumn in
the case of a CompositeRuler, whereas you don't have to fully populate it
in advance with a VerticalRuler? That wouldn't make a lot of sense. It's
like the parent classes (i.e. SourceViewer) can't figure out that the
AnnotationRulerColumn is taking the place of the VerticalRuler... do I
have to call something to tell the parent classes that my
AnnotationRulerColumn **IS** the VerticalRuler so it can apply the
annotations? I don't see a SourceViewer.setVerticalRuler() method,
though. Do you have to override getVerticalRuler so it returns the
AnnotationRulerColumn in the case of a CompositeRuler?
If I change my code back to create a VerticalRuler instead of a
CompositeRuler, with NO other changes (i.e. comment ONE line, uncomment
the other), the annotations show up. This is in an Eclipse v3.2 plugin.
ANY thoughts or pointers of things to check out are gratefully received
:-).
Happy Holidays, everyone! :-)
Thanks,
Bret
|
|
|
Re: Moving from VerticalRuler to CompositeRuler, annotations lost [message #333772 is a reply to message #333660] |
Mon, 05 January 2009 08:19 |
Tom Hofmann Messages: 770 Registered: July 2009 |
Senior Member |
|
|
Hi Bret,
The vertical ruler is set from the SourceViewer constructor (I assume
that is what you are doing now...) - there is no other place to set it
and it should be enough.
Debug to see if your AnnotationRulerColumn has the proper
IAnnotationModel set (via CompositeRuler::setModel)? Do you need to set
the IAnnotationAccess?
If your viewer is part of an AbstractDecoratedTextEditor, also consider
overwriting createAnnotationRulerColumn instead, or using the
rulerColumns extension point.
-tom
Bret Schuhmacher wrote:
> Hi all - I've spent days trying various things, doing research, etc. and
> I'm no closer to a solution.
> I've got a subclass of SourceViewer that originally created a
> VerticalRuler and showed annotations properly.
>
> I took that code and replaced the VerticalRuler with a CompositeRuler
> and added an AnnotationRulerColumn and a LineNumberRulerColumn. I also
> added an OverviewRuler. All rulers show, but the AnnotationRulerColumn
> doesn't show any annotations, although I've got styled text in the
> document (i.e. squigglys underlining text). The OverviewRuler shows,
> but is also empty; I'm not worried about it at the moment...
>
> Do you have to manually do more when you try to hook in an
> AnnotationRulerColumn vs. a VerticalRuler? Do you have to fully
> populate the AnnotationModel *before* connecting it to an
> AnnotationRulerColumn in the case of a CompositeRuler, whereas you don't
> have to fully populate it in advance with a VerticalRuler? That
> wouldn't make a lot of sense. It's like the parent classes (i.e.
> SourceViewer) can't figure out that the AnnotationRulerColumn is taking
> the place of the VerticalRuler... do I have to call something to tell
> the parent classes that my AnnotationRulerColumn **IS** the
> VerticalRuler so it can apply the annotations? I don't see a
> SourceViewer.setVerticalRuler() method, though. Do you have to override
> getVerticalRuler so it returns the AnnotationRulerColumn in the case of
> a CompositeRuler?
>
> If I change my code back to create a VerticalRuler instead of a
> CompositeRuler, with NO other changes (i.e. comment ONE line, uncomment
> the other), the annotations show up. This is in an Eclipse v3.2 plugin.
>
> ANY thoughts or pointers of things to check out are gratefully received
> :-).
>
> Happy Holidays, everyone! :-)
>
> Thanks,
>
> Bret
>
|
|
|
Powered by
FUDForum. Page generated in 0.27600 seconds