Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Moving from VerticalRuler to CompositeRuler, annotations lost
Moving from VerticalRuler to CompositeRuler, annotations lost [message #333660] Sun, 21 December 2008 21:48 Go to next message
Bret Schuhmacher is currently offline Bret SchuhmacherFriend
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 Go to previous message
Tom Hofmann is currently offline Tom HofmannFriend
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
>
Previous Topic:LinkedResources for resources with same name
Next Topic:dispose() for extended Document?
Goto Forum:
  


Current Time: Fri Jul 19 12:26:13 GMT 2024

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

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

Back to the top