Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Column editable in a Tree
Column editable in a Tree [message #460513] Tue, 30 August 2005 16:15 Go to next message
Eclipse UserFriend
Originally posted by: OE_PROMOS.TERRA.ES

Hello I have a tree with 3 columns

I have right the code to edit a column : TreeEditor, Events... etc..

The problem :

I don't know the way to "detect" in which column the user has done "click".

I have

tree.addListener(SWT.Selection, new Listener ()
{
public void handleEvent (Event event)
{
final TreeItem item = (TreeItem) event.item;

// in this point I have all the row... but How could detect in which
column the user has "throw" the event?
Re: Column editable in a Tree [message #460748 is a reply to message #460513] Tue, 06 September 2005 16:42 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
SWT.Selection is a higher-level event than you want to use here. Instead
you should listen for SWT.MouseDown, and compute the column, as demonstrated
in:

http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet3.java?rev=HEAD&am p;content-type=text/vnd.viewcvs-markup
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet110.java?rev=HEAD& amp;content-type=text/vnd.viewcvs-markup

Grant

"Oscar Escudero" <OE_PROMOS@TERRA.ES> wrote in message
news:3b7258f52a4c4f9fa13ac7751989fc82$1@www.eclipse.org...
> Hello I have a tree with 3 columns
>
> I have right the code to edit a column : TreeEditor, Events... etc..
>
> The problem :
>
> I don't know the way to "detect" in which column the user has done
"click".
>
> I have
>
> tree.addListener(SWT.Selection, new Listener ()
> {
> public void handleEvent (Event event)
> {
> final TreeItem item = (TreeItem) event.item;
>
> // in this point I have all the row... but How could detect in which
> column the user has "throw" the event?
>
>
Previous Topic:CCombo issues...
Next Topic:java and swt libs compatibility
Goto Forum:
  


Current Time: Thu Apr 25 13:49:43 GMT 2024

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

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

Back to the top