VIRTUAL TableViewer: getting selections [message #461871] |
Tue, 04 October 2005 02:47 |
Jeff Magill Messages: 15 Registered: July 2009 |
Junior Member |
|
|
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).
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04952 seconds