programatically set table selection in SWT

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

programatically set table selection in SWT

olarte.andres
I trying to set programatically the selection in a table that uses an EventList:

   table.select(0);
   selection = virtualTableViewer.getSelected();
   logger.debug("Size: " + selection.size());
       
The size of the selection is 0, even though the table has the first
row selected.  If I click on the table and select any row, and then
modify the selection programatically, it works.  Here's the code for
that part:

    virtualTableViewer.select(new
int[]{virtualTableViewer.getSelectionIndex()+1});
    selection=virtualTableViewer.getSelected();
    logger.debug("SIZE: " +selection.size());

If I do this BEFORE clicking on the table, the size comes out as 0.


Is this a bug, or am I missing something? Thanks for your help !!

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: programatically set table selection in SWT

Jesse Wilson

Hey Andres ---

This is a bug! I have filed a bug report here:
https://glazedlists.dev.java.net/issues/show_bug.cgi?id=260

There have been a handful of issues with our
SWT EventTableModel lately, mostly related to
selection and virtual table support. This is a
growing concern and I think I am going to have
to spend some time this weekend working on
that class. Although most of our implementation
seems solid, I think that the our listeners aren't
always notified by SWT, which makes it quite
troublesome to get these types of things correct!

Anyway, thanks for the heads up and I'll see
what I can do over the weekend!

Cheers,
Jesse




On 24-Aug-05, at 10:49 AM, Andres Olarte wrote:

> I trying to set programatically the selection in a table that uses  
> an EventList:
>
>    table.select(0);
>    selection = virtualTableViewer.getSelected();
>    logger.debug("Size: " + selection.size());
>
> The size of the selection is 0, even though the table has the first
> row selected.  If I click on the table and select any row, and then
> modify the selection programatically, it works.  Here's the code for
> that part:
>
>     virtualTableViewer.select(new
> int[]{virtualTableViewer.getSelectionIndex()+1});
>     selection=virtualTableViewer.getSelected();
>     logger.debug("SIZE: " +selection.size());
>
> If I do this BEFORE clicking on the table, the size comes out as 0.
>
>
> Is this a bug, or am I missing something? Thanks for your help !!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


smime.p7s (3K) Download Attachment