Bug 262412 - [Viewers] SWT.VIRTUAL Shift Click selection doesn't work.
Summary: [Viewers] SWT.VIRTUAL Shift Click selection doesn't work.
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3.2   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: helpwanted
Depends on:
Blocks: 509006
  Show dependency tree
 
Reported: 2009-01-26 13:40 EST by Matthew Kirkley CLA
Modified: 2020-08-04 06:06 EDT (History)
4 users (show)

See Also:


Attachments
main runner to show bug (follow steps in my comment) (5.85 KB, application/octet-stream)
2009-01-26 16:57 EST, Matthew Kirkley CLA
no flags Details
sample screenshot of bug recreation program (18.96 KB, image/png)
2009-01-26 16:59 EST, Matthew Kirkley CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Kirkley CLA 2009-01-26 13:40:05 EST
If you have a SWT.VIRTUAL table selection outside of the visible range will return TableItems that have null data (call to getData returns null) because they are still virtually allocated.

So if you had many items in a table and click the first row and then scroll down to the bottom and shift click the last row to select all items. A call to tableViewer.getElementAt(5000) if you had 10000 rows would return null.
Comment 1 Felipe Heidrich CLA 2009-01-26 15:25:46 EST
do you have a snippet, using SWT only, to show this problem ?
Comment 2 Matthew Kirkley CLA 2009-01-26 16:57:10 EST
Created attachment 123816 [details]
main runner to show bug (follow steps in my comment)
Comment 3 Matthew Kirkley CLA 2009-01-26 16:57:32 EST
Comment on attachment 123816 [details]
main runner to show bug (follow steps in my comment)

I'm sorry I think I may have posted this in the wrong area. I didn't see JFace in the component area.

This is a problem with a SWT.VIRTUAL table using a deferred content provider... I have attached sample code.

If you load the code and click button 1
you will see that the call to tableViewer.getElementAt(..) to a not yet visualized element returns null.

Next, click the first table row, then drag the scroll bar down to the bottom element.  Hold in your shift key and click the bottom element (ie: select all rows).  Now click button 2.  Notice that the selection size that the viewer returns is only a fraction of the 20,000 populated models.  This is basically because of the virtual elements return null when their getData method is called.

You don't seem to have API access to 'hack' the background content provider to refresh these virtual elements, so there seems to be no work around as I can see with out overriding the jface code.

I have attached a screenshot and the bug recreation.
Comment 4 Matthew Kirkley CLA 2009-01-26 16:59:02 EST
Created attachment 123818 [details]
sample screenshot of bug recreation program

same screenshot of bug recreation code.
Comment 5 Felipe Heidrich CLA 2009-01-26 17:23:49 EST
Reassigning to UI for now. Please send it back if it turns to be SWT.
Comment 6 Boris Bokowski CLA 2009-01-29 21:31:56 EST
There are several problems with the code in the viewers.deferred package. I am tempted to just mark it deprecated because we don't have the resources to fix the issues, and don't know of any clients that use it successfully.

Can you reproduce the problem without using viewers.deferred, i.e. with only TableViewer and either an IStructuredContentProvider or ILazyContentProvider?
Comment 7 Matthew Kirkley CLA 2009-01-30 09:20:07 EST
Do you know of a way to populate the table in a background thread. I don't care so much about sorting in a background thread.  My business requirements are to be able to cancel the population of the table at any time and populate it with what has been retrieved so far...

You may want to see if the contact at http://publicsvn.bestsolution.at/WebSVN/listing.php?repname=svnpublic&path=%2F&sc=0 may have some information.  I started a dialog with him and it seems that he was planning to fix .deferred .  

Unfortunately it doesn't look like I have any time at the moment to help out.
Comment 8 Boris Bokowski CLA 2009-01-30 11:51:15 EST
(In reply to comment #7)
> You may want to see if the contact at
> http://publicsvn.bestsolution.at/WebSVN/listing.php?repname=svnpublic&path=%2F&sc=0
> may have some information.  I started a dialog with him and it seems that he
> was planning to fix .deferred .  

Tom?
Comment 9 Boris Bokowski CLA 2009-01-30 11:51:48 EST
Sorry, wrong field ;)
Comment 10 Thomas Schindl CLA 2009-01-30 19:29:39 EST
Well async is on the list of issues of the E4-Viewers rewrite I've started but there's no concrete plan currently.
Comment 11 Boris Bokowski CLA 2009-11-26 09:56:01 EST
Hitesh is now responsible for watching bugs in the [Viewers] component area.
Comment 12 Eclipse Genie CLA 2020-08-04 06:06:05 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.