Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Table setSelection() bug?
Table setSelection() bug? [message #448088] Fri, 31 December 2004 01:25 Go to next message
Eclipse UserFriend
Originally posted by: gopowereclipse.yahoo.com

I have a table (SWT table widget) and populated the table with a number of
rows. I want to programmatically set the selection to the first row. I have
a SelectionListener registered with the table. When I use
table.setSelection(0);
to set the selection to the first row, my SelectionListener is not notified.
However, mouse selection on the table rows does trigger the
SelectionListener. Is this a bug? How can I programmatically set selection
and be notified that the selection has happened? Thanks a lot for your help.

--Vivian
Re: Table setSelection() bug? [message #448098 is a reply to message #448088] Sat, 01 January 2005 20:40 Go to previous message
Eclipse UserFriend
Originally posted by: micasim.gmx.de

On Thu, 30 Dec 2004 17:25:45 -0800, Vivian <gopowereclipse@yahoo.com>
wrote:

>
> I have a table (SWT table widget) and populated the table with a number
> of
> rows. I want to programmatically set the selection to the first row. I
> have
> a SelectionListener registered with the table. When I use
> table.setSelection(0);
> to set the selection to the first row, my SelectionListener is not
> notified.
> However, mouse selection on the table rows does trigger the
> SelectionListener. Is this a bug? How can I programmatically set
> selection
> and be notified that the selection has happened? Thanks a lot for your
> help.
>
> --Vivian
>
>

Hi Vivian,

don't know for sure but I guess it's a featue. Assume a Tree and Table
combination (as in many explorers). The Table listens for selection events
on the tree and vice versa. When a the table gets informed about a
selection event on the tree it sets its own selection accordingly. If a
selection event was triggered, the tree would get informed and would set
its selection again and the never ending loop is ready to start.
When setting the selection via setSelection() you also can fire the event
programmaticaly, if you're sure not to risk a endless loop like the one
described.

hope this helps,
Michael
Previous Topic:Help needed with a slider issue.
Next Topic:View Change Keyboard Bindings Not Working on Fedora Core 3/KDE
Goto Forum:
  


Current Time: Tue Apr 23 17:35:58 GMT 2024

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

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

Back to the top