Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » How to display ToolTip on Mouse Hover over VerticalRuler
How to display ToolTip on Mouse Hover over VerticalRuler [message #997483] Mon, 07 January 2013 18:04
Grace Hopper is currently offline Grace HopperFriend
Messages: 1
Registered: January 2013
Junior Member
Hi there Smile.

This is not an easy problem, so please bear with me Smile.

I add Annotations to the left hand-side Vertical Ruler (IVerticalRuler) of an AbstractTextEditor (I use the default Java Editor here). The annotation is displayed and rendered nicely with a vertical bar, just like I want it. I also set a ToolTipText by Overriding Annotation's getText() method. This works fine. However, the tool tip is only displayed when I hover over the first line of the annotation. My annotations can stretch many lines. The tooltip should of course also be displayed in all lines, not just in the first line.

See attached picture for how the tool tip is shown when on the first line of the finding. Not shown when below the first line, though Sad


I de-bugged into this and found that in the Annotation class the getText method for the display of the tool tip isn't called when the mouse cursor hovers over succeeding lines. This is because in class DefaultAnnotationHover (in package org.eclipse.jface.text.source) the method isRulerLine returns false when line and the line calculated from position don't match. So I basically needed to reimplement/override isRulerLine, but I have no idea how to do so. Remember, I am using the default Java Editor.

Some help would be greatly appreciated.

Previous Topic:ToolBarManager items stacked vertically instead of horizontally
Next Topic:How to change enablement state of ControlContribution
Goto Forum:

Current Time: Mon Jun 18 15:54:29 GMT 2018

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

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

Back to the top