Can't get Code Folding Hover text to work [message #306277] |
Wed, 26 July 2006 09:59  |
Eclipse User |
|
|
|
I have attempted to follow the example at:
http://www.eclipse.org/www/articles/Article-Folding-in-Eclip se-Text-Editors/folding.html
and have not had any luck getting the hover tip to show up. The same
question has been posted several times before with no solution yet:
http://dev.eclipse.org/newslists/news.eclipse.platform/msg44 918.html
http://dev.eclipse.org/newslists/news.eclipse.newcomer/msg09 895.html
In one of the responses, it was suggested that the following method
should be debugged:
ProjectionAnnotationHover.getHoverInfo(ISourceViewer, ILineRange, int)
Unfortunately, that method is not being called. The problem appears to
be earlier, in the mouse handling.
The doEnableProjection() method does seem to be called successfully.
I've looked at the Java Editor (where this works just fine), and have
not seen any obvious relevant difference (although the Java editor does
a lot of setup). In the Java Editor, the mouse event appears to come
from AnnotationRuleColumn$5, but I haven't been able to tell why my
instance of that class wouldn't send the same event.
Are there any other suggestions?
Thanks,
Ernest
|
|
|
Re: Can't get Code Folding Hover text to work [message #306305 is a reply to message #306277] |
Wed, 26 July 2006 12:34   |
Eclipse User |
|
|
|
Originally posted by: tom_eicher.ch.ibm.com
Ernest,
not sure what's going wrong. One thing I noticed when I quickly glanced
through the code and that may be the culprit:
For hovers to work, the ruler must have an AnnotationBarHoverManager
installed. This occurs in
SourceViewer#ensureAnnotationHoverManagerInstalled, which only installs
a manager if the following conditions are met:
- a vertical ruler is in place (I assume you have that)
- the SourceViewerConfiguration has provided an IAnnotationHover
@see SourceViewerConfiguration.getAnnotationHover()
- the SourceViewerConfiguration has provided a hover control creator
@see SourceViewerConfiguration.getInformationControlCreator()
Note that the latter is not needed directly for the projection hover,
since you provide a creator yourself. But it may be that the hovering
controller never gets setup.
Just something to check - please report back if this helps.
-tom
Ernest Pasour wrote:
> I have attempted to follow the example at:
> http://www.eclipse.org/www/articles/Article-Folding-in-Eclip se-Text-Editors/folding.html
> and have not had any luck getting the hover tip to show up. The same
> question has been posted several times before with no solution yet:
> http://dev.eclipse.org/newslists/news.eclipse.platform/msg44 918.html
> http://dev.eclipse.org/newslists/news.eclipse.newcomer/msg09 895.html
>
> In one of the responses, it was suggested that the following method
> should be debugged:
> ProjectionAnnotationHover.getHoverInfo(ISourceViewer, ILineRange, int)
>
> Unfortunately, that method is not being called. The problem appears to
> be earlier, in the mouse handling.
>
> The doEnableProjection() method does seem to be called successfully.
>
> I've looked at the Java Editor (where this works just fine), and have
> not seen any obvious relevant difference (although the Java editor does
> a lot of setup). In the Java Editor, the mouse event appears to come
> from AnnotationRuleColumn$5, but I haven't been able to tell why my
> instance of that class wouldn't send the same event.
>
> Are there any other suggestions?
>
> Thanks,
> Ernest
|
|
|
Re: Can't get Code Folding Hover text to work [message #306311 is a reply to message #306305] |
Wed, 26 July 2006 13:24   |
Eclipse User |
|
|
|
That was it. Thank you! I added the following override to my source
viewer configuration and the hover works as expected. Should I be
subclassing from TextSourceViewerConfiguration instead of
SourceViewerConfiguration?
public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer)
{
return new DefaultAnnotationHover();
}
Tom Eicher wrote:
> Ernest,
>
> not sure what's going wrong. One thing I noticed when I quickly glanced
> through the code and that may be the culprit:
>
> For hovers to work, the ruler must have an AnnotationBarHoverManager
> installed. This occurs in
> SourceViewer#ensureAnnotationHoverManagerInstalled, which only installs
> a manager if the following conditions are met:
>
> - a vertical ruler is in place (I assume you have that)
> - the SourceViewerConfiguration has provided an IAnnotationHover
> @see SourceViewerConfiguration.getAnnotationHover()
> - the SourceViewerConfiguration has provided a hover control creator
> @see SourceViewerConfiguration.getInformationControlCreator()
>
> Note that the latter is not needed directly for the projection hover,
> since you provide a creator yourself. But it may be that the hovering
> controller never gets setup.
>
> Just something to check - please report back if this helps.
> -tom
>
> Ernest Pasour wrote:
>> I have attempted to follow the example at:
>> http://www.eclipse.org/www/articles/Article-Folding-in-Eclip se-Text-Editors/folding.html
>> and have not had any luck getting the hover tip to show up. The same
>> question has been posted several times before with no solution yet:
>> http://dev.eclipse.org/newslists/news.eclipse.platform/msg44 918.html
>> http://dev.eclipse.org/newslists/news.eclipse.newcomer/msg09 895.html
>>
>> In one of the responses, it was suggested that the following method
>> should be debugged:
>> ProjectionAnnotationHover.getHoverInfo(ISourceViewer, ILineRange, int)
>>
>> Unfortunately, that method is not being called. The problem appears
>> to be earlier, in the mouse handling.
>>
>> The doEnableProjection() method does seem to be called successfully.
>>
>> I've looked at the Java Editor (where this works just fine), and have
>> not seen any obvious relevant difference (although the Java editor
>> does a lot of setup). In the Java Editor, the mouse event appears to
>> come from AnnotationRuleColumn$5, but I haven't been able to tell why
>> my instance of that class wouldn't send the same event.
>>
>> Are there any other suggestions?
>>
>> Thanks,
>> Ernest
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.27997 seconds