|
|
|
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 message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Alex Le![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=unbonnevie%40yahoo.com) 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 message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Dani Megert![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=Daniel_Megert%40ch.ibm.com) 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.03628 seconds