Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How to : Add mouse hover info to marker and notify location in ruler
How to : Add mouse hover info to marker and notify location in ruler [message #487470] Wed, 23 September 2009 11:23 Go to next message
Prasanna K is currently offline Prasanna KFriend
Messages: 78
Registered: July 2009
Member
Hi,

I am developing a plug-in using eclipse-3.4.2 on WinXP.
The plug-in uses native editor but has its own views.
I have a created a custom marker (with special icon and so on) which works fine.

Now I want its (marker's) location to be shown in the right-side ruler of the java editor in some explicitly mentioned color. Like eclipse shows location of a line with
an error with a red mark /
a warning with a yellow mark.

I also want to provide mouse-hover informations like:
A mouse-hover on the location-indicator on ruler should display line number.
A mouse-hover on the marker icon of a particular line should display a tool-tip-text kind of yellow box with some imp information.

I was told by Paul in irc that I should use AbstractDecoratedTextEditor.
Then realized (after going through help) I'll need to use the extension point org.eclipse.ui.workbench.texteditor.rulerColumns
I didn't find any article / example of usage of that ex point despite of plenty of web-searches.

The question is, how to achieve all the above without having a custom editor and in connection with a marker?

Thanks.
Re: How to : Add mouse hover info to marker and notify location in ruler [message #487998 is a reply to message #487470] Fri, 25 September 2009 09:12 Go to previous messageGo to next message
Prasanna K is currently offline Prasanna KFriend
Messages: 78
Registered: July 2009
Member
Have found answer to one of my two questions.
Adding tool-tip kind-of yellow box to the mouse hover on marker was easy.
I had to do this :
marker.setAttribute(IMarker.MESSGE, "Hello...");

Now it'd be really appreciated if someone could explain how to go about adding a notation to the right side ruler which would display line number on mouse hover for the above said marker.

Thanks.
Re: How to : Add mouse hover info to marker and notify location in ruler [message #491625 is a reply to message #487998] Thu, 15 October 2009 09:40 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
kaprasi wrote:
> Have found answer to one of my two questions.
> Adding tool-tip kind-of yellow box to the mouse hover on marker was easy.
> I had to do this :
> marker.setAttribute(IMarker.MESSGE, "Hello...");
>
> Now it'd be really appreciated if someone could explain how to go
> about adding a notation to the right side ruler which would display
> line number on mouse hover for the above said marker.
You can't show a different message. See
'org.eclipse.ui.editors.markerAnnotationSpecification' extension point
on how to let your marker appear in the ruler.

Dani
>
> Thanks.
Re: How to : Add mouse hover info to marker and notify location in ruler [message #491630 is a reply to message #491625] Thu, 15 October 2009 09:59 Go to previous messageGo to next message
Prasanna K is currently offline Prasanna KFriend
Messages: 78
Registered: July 2009
Member

Dani Megert wrote on Thu, 15 October 2009 05:40

You can't show a different message. See
'org.eclipse.ui.editors.markerAnnotationSpecification' extension point
on how to let your marker appear in the ruler.

Dani
>
> Thanks.


Yes. I realized that and have successfully made use of the extension point org.eclipse.ui.editors.markerAnnotationSpecification and it works fine.
i.e. It displays the intended message on mouse hover on both marker as well as annotation.
This thread can be closed now if it should be.

Thanks.
Re: How to : Add mouse hover info to marker and notify location in ruler [message #522757 is a reply to message #487998] Tue, 23 March 2010 20:30 Go to previous message
Kitesurfer () is currently offline Kitesurfer ()Friend
Messages: 87
Registered: December 2009
Member
kaprasi wrote on Fri, 25 September 2009 05:12
I had to do this :
marker.setAttribute(IMarker.MESSGE, "Hello...");
Thanks.


This doesn't work ... when I code this no Tooltip is shown when I move the mouse over the marker. Any idea why ?
Previous Topic:Where is configuration of workspace projects?
Next Topic:Programmatically get file being debugged in eclipse -- guys some help
Goto Forum:
  


Current Time: Sat Jul 27 10:06:29 GMT 2024

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

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

Back to the top