Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Table Get Selected Cell
Table Get Selected Cell [message #464648] Sat, 26 November 2005 23:06 Go to next message
Jeff Yuan is currently offline Jeff Yuan
Messages: 34
Registered: July 2009
Member
Hi,
How can I figure out which cell is selected when a selection occurs? I
can easily figure out which row it is, but how do I figure out which
column it is?
Re: Table Get Selected Cell [message #464649 is a reply to message #464648] Sat, 26 November 2005 23:28 Go to previous messageGo to next message
Jeff Yuan is currently offline Jeff Yuan
Messages: 34
Registered: July 2009
Member
Nevermind, I found the solution. You could get the x, y coordinate from
the event, and then check to see whether it is in the bounds of the column.
Re: Table Get Selected Cell [message #464671 is a reply to message #464649] Mon, 28 November 2005 15:29 Go to previous message
Veronika Irvine is currently offline Veronika Irvine
Messages: 1272
Registered: July 2009
Senior Member
Please note that a row can be selected using the keyboard and in this case
you do not have the x and y coordinates to determine a cell. That is why
the selection event does not have x and y coordinates. In the native table,
you are not selecting an individual cell but rather a row.

If you want to select a cell, take a look at TableCursor:

http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet96.java?rev=HEAD&a mp;content-type=text/vnd.viewcvs-markup

"zinc" <zincsterio@yahoo.com> wrote in message
news:cde22fa6412886c259e9b3b81e99ae2e$1@www.eclipse.org...
> Nevermind, I found the solution. You could get the x, y coordinate from
> the event, and then check to see whether it is in the bounds of the
> column.
>
Previous Topic:selectinh multiple items in SWT Table
Next Topic:How to avoid paint merging ?
Goto Forum:
  


Current Time: Wed Oct 01 22:38:34 GMT 2014

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

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