|
Re: selected column index given a TableItem [message #450390 is a reply to message #450366] |
Fri, 11 February 2005 13:43 |
Veronika Irvine Messages: 1272 Registered: July 2009 |
Senior Member |
|
|
A table item can be selected in many ways. If it is selected through a
mouse event, you can get the x/y-coordinates from the mouse event and
determine the column at the point using one of the following snippets:
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
or
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
However, a table item can be selected by using the arrow keys or
programmatically. In these cases, you can't really specify on which column
the selection occurred because the whole row is selected.
"AL" <unbonnevie@yahoo.com> wrote in message
news:cugihf$chk$1@www.eclipse.org...
> Hi,
>
> I have a class with a table with columns. The class also implements
> org.eclipse.jface.viewers.ICellModifier.
>
> My question:
>
> My Eclipse call my implementation of ICellModifier.modify(Object element,
> String property, Object value), how would I know the column index WITHOUT
> using the "property" value? In other words, can I used the passed in
> 'element', which is a TableItem, to find out which column index/id was
> edited?
>
> Many thanks!
>
|
|
|
Powered by
FUDForum. Page generated in 0.03468 seconds