Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to highlight items with ListViewer when mouse moves?
How to highlight items with ListViewer when mouse moves? [message #503312] Fri, 11 December 2009 13:35 Go to next message
Eclipse UserFriend
Hi,

I have a ListViewer that has a List of items, I want to highlight any item when mouse moves over it:

final List list = listViewer.getList();
list.addMouseMoveListener( new MouseMoveListener()
{
public void mouseMove( MouseEvent e )
{
Point pt = new Point( e.x, e.y );
//how to get the item on which mouse just moved over?
}
} );

The trouble is: either ListViewer or List has a getItem(Point p) implementation like Table.getItem(Point p). I am wondering if we have existing functionalities to achieve this?

thanks,
Re: How to highlight items with ListViewer when mouse moves? [message #503417 is a reply to message #503312] Sun, 13 December 2009 15:23 Go to previous message
Eclipse UserFriend
Hi,

> The trouble is: either ListViewer or List has a getItem(Point p)
> implementation like Table.getItem(Point p). I am wondering if we have
> existing functionalities to achieve this?

You say it would work with a TableViewer? Then change your ListViewer to
a 1-column TableViewer. It's more handy in general and a useful trick
to get around other ListViewer inconveniences.
Previous Topic:Open browser links in OS Default Web browser
Next Topic:Render HTML into a StyledText
Goto Forum:
  


Current Time: Sat Jul 05 04:36:55 EDT 2025

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

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

Back to the top