Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to get the text under the mouse in the org.eclipse.swt.widgets.Text
How to get the text under the mouse in the org.eclipse.swt.widgets.Text [message #435657] Sun, 21 August 2005 21:25 Go to next message
Eclipse UserFriend
Originally posted by: yewb.archean.net

In eclipse's java editor, when mouse is over a text, such as a method, so,
a hoverhelp will be popped up.

But how can I get the text under the mouse in my application?

Can I use org.eclipse.swt.widgets.Text to do it?
Re: How to get the text under the mouse in the org.eclipse.swt.widgets.Text [message #435713 is a reply to message #435657] Mon, 22 August 2005 09:36 Go to previous messageGo to next message
Eclipse UserFriend
This is done much easier with a StyledText since it provides a
getOffsetAtLocation(Point) API that answers the text offset for a given x,y
coordinate (in this case you would provide the x,y from the trigger
MouseHover event). Once you have the text index then you can use
getText(int,int) to get the text surrounding this point.

Grant

"yewb" <yewb@archean.net> wrote in message
news:deb9if$cdv$1@news.eclipse.org...
> In eclipse's java editor, when mouse is over a text, such as a method, so,
> a hoverhelp will be popped up.
>
> But how can I get the text under the mouse in my application?
>
> Can I use org.eclipse.swt.widgets.Text to do it?
>
>
Re: How to get the text under the mouse in the org.eclipse.swt.widgets.Text [message #435769 is a reply to message #435713] Tue, 23 August 2005 08:24 Go to previous message
Eclipse UserFriend
Originally posted by: yewb.archean.net

Thank you
: )

"Grant Gayed" <grant_gayed@ca.ibm.com> д
Previous Topic:how to prevent user to transfer a view from a folder to another
Next Topic:RCP WebStart problems
Goto Forum:
  


Current Time: Tue Nov 11 17:24:20 EST 2025

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

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

Back to the top