Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 17:08 Go to next message
Alex Le is currently offline Alex LeFriend
Messages: 649
Registered: July 2009
Senior Member
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] Tue, 11 March 2008 00:47 Go to previous messageGo to next message
Alex Le is currently offline Alex LeFriend
Messages: 649
Registered: July 2009
Senior Member
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 11:05 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
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 18:36 Go to previous messageGo to next message
Alex Le is currently offline Alex LeFriend
Messages: 649
Registered: July 2009
Senior Member
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 08:54 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
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 23:05 Go to previous message
Alex Le is currently offline Alex LeFriend
Messages: 649
Registered: July 2009
Senior Member
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: Thu Jun 27 19:47:04 GMT 2024

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

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

Back to the top