TraverseListener [message #464807] |
Wed, 30 November 2005 01:07  |
Eclipse User |
|
|
|
Hi,
I'm trying to implement a feature where in a table, when you press the
arrow keys (up or down) it goes to the next row selects the data and does
something with it. However, when I try to get selection (by
getSelection()[0].getData()) it always returns the previous row's
information.
For example, say I'm currently at row 1, and I press down arrow key. The
selection goes to row 2 now. When I get the current selection in the
attached TraverseListener, it returns the data for row 1. So there is
always a phase difference of 1 in the selection. Can anyone give some
tips as to how I may address this?
Thanks.
|
|
|
|
|
Re: TraverseListener [message #464860 is a reply to message #464829] |
Wed, 30 November 2005 14:12  |
Eclipse User |
|
|
|
No, I would use SWT.Selection listener.
"zinc" <zincsterio@yahoo.com> wrote in message
news:5f0575c1cabeb59aa403d14ce5c34398$1@www.eclipse.org...
> So would you suggest use KeyListener? The same problem seem to still
> occur. I have the KeyListener detect for example when KeyCode is equal to
> SWT.ARROW_DOWN and get selection, but the gotten selection still seems to
> be the old one.
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.12665 seconds