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