Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » How to have AnnotationPainter use my AnnotationPainter.IDrawingStrategy?
How to have AnnotationPainter use my AnnotationPainter.IDrawingStrategy? [message #326184] Mon, 10 March 2008 13:08 Go to next message
Eclipse UserFriend
Hi,

I know how to make my own annotation types, just need to correctly have
my editor, which inherits TextEditor, to use my own
AnnotationPainter.IDrawingStrategy. Tips and/or example(s) would be
appreciated. Thanks.
Re: How to have AnnotationPainter use my AnnotationPainter.IDrawingStrategy? [message #326190 is a reply to message #326184] Mon, 10 March 2008 20:47 Go to previous messageGo to next message
Eclipse UserFriend
AL wrote:
> Hi,
>
> I know how to make my own annotation types, just need to correctly have
> my editor, which inherits TextEditor, to use my own
> AnnotationPainter.IDrawingStrategy. Tips and/or example(s) would be
> appreciated. Thanks.

To clarify that my annotations implement
org.eclipse.jface.text.source.IAnnotationPresentation, because the
annotation types are dynamically created. Thus, I cannot use extension
points.
Re: How to have AnnotationPainter use my AnnotationPainter.IDrawingStrategy? [message #326264 is a reply to message #326190] Thu, 13 March 2008 07:05 Go to previous messageGo to next message
Eclipse UserFriend
AL wrote:
> AL wrote:
>> Hi,
>>
>> I know how to make my own annotation types, just need to correctly
>> have my editor, which inherits TextEditor, to use my own
>> AnnotationPainter.IDrawingStrategy. Tips and/or example(s) would be
>> appreciated. Thanks.
>
> To clarify that my annotations implement
> org.eclipse.jface.text.source.IAnnotationPresentation, because the
> annotation types are dynamically created. Thus, I cannot use
> extension points.
See:
org.eclipse.jface.text.source.AnnotationPainter.addDrawingSt rategy(Object,
IDrawingStrategy) and if you are using 3.4:
org.eclipse.jface.text.source.AnnotationPainter.addTextStyle Strategy(Object,
ITextStyleStrategy).

Please note that IAnnotationPresentation is only designed for drawing
onto the vertical ruler and not into the text area (which is handled by
the AnnotationPainter).

Dani
Re: How to have AnnotationPainter use my AnnotationPainter.IDrawingStrategy? [message #326323 is a reply to message #326264] Fri, 14 March 2008 14:36 Go to previous messageGo to next message
Eclipse UserFriend
Daniel Megert wrote:
> AL wrote:
>> AL wrote:
>>> Hi,
>>>
>>> I know how to make my own annotation types, just need to correctly
>>> have my editor, which inherits TextEditor, to use my own
>>> AnnotationPainter.IDrawingStrategy. Tips and/or example(s) would be
>>> appreciated. Thanks.
>>
>> To clarify that my annotations implement
>> org.eclipse.jface.text.source.IAnnotationPresentation, because the
>> annotation types are dynamically created. Thus, I cannot use
>> extension points.
> See:
> org.eclipse.jface.text.source.AnnotationPainter.addDrawingSt rategy(Object,
> IDrawingStrategy) and if you are using 3.4:
> org.eclipse.jface.text.source.AnnotationPainter.addTextStyle Strategy(Object,
> ITextStyleStrategy).
>

The problem is that I can't get to the AnnotationPainter object from
SourceViewerDecorationSupport, since the annotation painter is declared
private and is created by a private method in
SourceViewerDecorationSupport, which does not have an accessor to get
the AnnotationPainter.

Any tips on how to go about this, without making all sorts of
inheritance and overrides? Thx.

> Please note that IAnnotationPresentation is only designed for drawing
> onto the vertical ruler and not into the text area (which is handled by
> the AnnotationPainter).
>
> Dani
Re: How to have AnnotationPainter use my AnnotationPainter.IDrawingStrategy? [message #326331 is a reply to message #326323] Sat, 15 March 2008 04:54 Go to previous messageGo to next message
Eclipse UserFriend
AL wrote:
> Daniel Megert wrote:
>> AL wrote:
>>> AL wrote:
>>>> Hi,
>>>>
>>>> I know how to make my own annotation types, just need to correctly
>>>> have my editor, which inherits TextEditor, to use my own
>>>> AnnotationPainter.IDrawingStrategy. Tips and/or example(s) would be
>>>> appreciated. Thanks.
>>>
>>> To clarify that my annotations implement
>>> org.eclipse.jface.text.source.IAnnotationPresentation, because the
>>> annotation types are dynamically created. Thus, I cannot use
>>> extension points.
>> See:
>> org.eclipse.jface.text.source.AnnotationPainter.addDrawingSt rategy(Object,
>> IDrawingStrategy) and if you are using 3.4:
>> org.eclipse.jface.text.source.AnnotationPainter.addTextStyle Strategy(Object,
>> ITextStyleStrategy).
>>
>
> The problem is that I can't get to the AnnotationPainter object from
> SourceViewerDecorationSupport, since the annotation painter is
> declared private and is created by a private method in
> SourceViewerDecorationSupport,
This is just not true. It is created in the protected non-final
createAnnotationPainter() method which you can implement in your own
subclass. You can even first call super to get the default annotation
painter.

Dani
> which does not have an accessor to get the AnnotationPainter.
>
> Any tips on how to go about this, without making all sorts of
> inheritance and overrides? Thx.
>
>> Please note that IAnnotationPresentation is only designed for drawing
>> onto the vertical ruler and not into the text area (which is handled
>> by the AnnotationPainter).
>>
>> Dani
>
Re: How to have AnnotationPainter use my AnnotationPainter.IDrawingStrategy? [message #326366 is a reply to message #326331] Mon, 17 March 2008 19:05 Go to previous message
Eclipse UserFriend
Daniel Megert wrote:

>> The problem is that I can't get to the AnnotationPainter object from
>> SourceViewerDecorationSupport, since the annotation painter is
>> declared private and is created by a private method in
>> SourceViewerDecorationSupport,
> This is just not true. It is created in the protected non-final
> createAnnotationPainter() method which you can implement in your own
> subclass. You can even first call super to get the default annotation
> painter.
>
> Dani
>> which does not have an accessor to get the AnnotationPainter.
>>
>> Any tips on how to go about this, without making all sorts of
>> inheritance and overrides? Thx.

Looked at the wrong places :-)
Previous Topic:Project Explorer not sorted on a refresh
Next Topic:SVN doesn't notice when file changes in my plugin
Goto Forum:
  


Current Time: Sat May 03 22:33:09 EDT 2025

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

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

Back to the top