Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » VIRTUAL TableViewer: getting selections
VIRTUAL TableViewer: getting selections [message #461871] Mon, 03 October 2005 22:47 Go to next message
Eclipse UserFriend
I have a VIRTUAL TableViewer using the deferred version of the lazy
content provider and I'm not sure how to go about getting the selected
items the best way.

How are people getting selections from VIRTUAL tables?

That is, if I use the TableViewer.getSelection(), it will leave out the
items the viewer hasn't loaded from my model yet (plus, that set of items
may be very large). For example, I loaded a table with 10000 items,
selected about the first 40 items, then I yanked the scrollbar down to the
1000th item and extended the selection thru item 1050 with the shift key.

TableViewer().getSelection() returned items 0-40 and 1000-1050 as if it
were a selection of two disjoint ranges. However, I could have used the
CTRL key to create such a selection so I can't always infer that the
intervening items are selected. (Also, there is the issue of sorting and
filtering but I'm not going there, yet.)

The style for the table I'm using is SWT.MULTI and SWT.FULL_SELECTION.

I was thinking that I could listen for selection changes on the table and
keep track of selections myself, but I thought I'd ask if there is an
example of this already. The selection events I tried listening to didn't
seem to have much data about how the selection was changed.

Perhaps if I compare the contents of a TableViewer.getSelection() after
the selection is changed with the contents in a prior selection, I can
infer the type of selection modification that occured (like when the two
selections have intersecting sets).
Re: VIRTUAL TableViewer: getting selections [message #461907 is a reply to message #461871] Tue, 04 October 2005 09:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

This sounds like it may be a bug. You should open a bugzilla and let
them address it and determine if this is the way it is supposed to work.

--
Thanks,
Rich Kulp
Re: VIRTUAL TableViewer: getting selections [message #461930 is a reply to message #461907] Tue, 04 October 2005 16:48 Go to previous message
Eclipse UserFriend
> This sounds like it may be a bug. You should open a bugzilla and let
> them address it and determine if this is the way it is supposed to work.

Thanks. I just realized I posted on the SWT newsgroup instead of
eclipse.platform one (which I believe is the proper place for jface
questions). So I'll try there first.


Jeff
Previous Topic:SWT Java Web Launch through jnlp for MAC
Next Topic:empty icons in an SWT Tree - can the hole be suppressed
Goto Forum:
  


Current Time: Tue Jul 08 07:08:49 EDT 2025

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

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

Back to the top