Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsHow to highlight items with ListViewer when mouse moves?
https://www.eclipse.org/forums/index.php/mv/msg/159346/503312/#msg_503312
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,]]>Rick C.2009-12-11T18:35:54-00:00Re: How to highlight items with ListViewer when mouse moves?
https://www.eclipse.org/forums/index.php/mv/msg/159346/503417/#msg_503417
> 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.]]>Felix Dorner2009-12-13T20:23:08-00:00