Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Tree/TreeViewer: How to detect a click into the icon without selecting the TreeItem
Tree/TreeViewer: How to detect a click into the icon without selecting the TreeItem [message #546555] Tue, 13 July 2010 11:16 Go to next message
Stefan Muller Arisona is currently offline Stefan Muller ArisonaFriend
Messages: 3
Registered: July 2009
Junior Member
Hello,

I have a SWT Tree and use a MouseListener to detect clicks into the icons of individual TreeItems.

First, is there a better way than to use a MouseListener to detect icon clicks?

Second, is there a way, to detect clicks on a TreeItem's icon without having it automatically selected (I tried with event.doit and similar stuff, without an effect)?

Thanks,
/Stefan
Re: Tree/TreeViewer: How to detect a click into the icon without selecting the TreeItem [message #547105 is a reply to message #546555] Thu, 15 July 2010 14:28 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2151
Registered: July 2009
Senior Member
> First, is there a better way than to use a MouseListener to detect icon
> clicks?

No, this is the way to do it.

> Second, is there a way, to detect clicks on a TreeItem's icon without
> having it automatically selected (I tried with event.doit and similar
> stuff, without an effect)?

Not specifically, but you can remember that the item's image was clicked and
then remove the item from the selection. For an example of filtering item
selections see
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet80.java?view=co .
I've tried this snippet on win32, gtk, and cocoa, and none of them show any
selection flash when selecting-then-deselecting an item.

HTH,
Grant
Previous Topic:Issues with SWT 3.5 and Solaris (Sparc)
Next Topic:Specifying Mozilla Version for SWT Browser
Goto Forum:
  


Current Time: Mon Dec 22 08:02:04 GMT 2014

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

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