|
|
|
Re: How to have AnnotationPainter use my AnnotationPainter.IDrawingStrategy? [message #326323 is a reply to message #326264] |
Fri, 14 March 2008 18:36 |
Alex Le 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 |
Dani Megert 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
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.02752 seconds