Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 18:35 Go to next message
Rick C. is currently offline Rick C.Friend
Messages: 9
Registered: July 2009
Junior Member
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 20:23 Go to previous message
Felix Dorner is currently offline Felix DornerFriend
Messages: 676
Registered: July 2009
Senior Member
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: Sun Dec 21 04:05:31 GMT 2014

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

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