Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 111743

Summary: [Viewers] Setting VIRTUAL TableViewer's input results in all TableItems being created
Product: [Eclipse Project] Platform Reporter: Jörg von Frantzius <jfrantzius>
Component: UIAssignee: Boris Bokowski <bokowski>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: n.a.edgar
Version: 3.2   
Target Milestone: 3.2 M3   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Jörg von Frantzius CLA 2005-10-06 05:33:58 EDT
[Eclipse 3.2 M2]

For a TableViewer with SWT.VIRTUAL flag, I call setInput(). That results in
TableViewer.virtualSetSelection(List, boolean) calling my
ILazyContentProvider.updateElement() for all rows in the table.

The comment in line 1149 of TableViewer(.virtualSetSelection()) says:

	//Now go through it again until all is done or we are no longer virtual
	//This may create all items so it is not a good
	//idea in general.
	//Use #setSelection (int [] indices,boolean reveal) instead
	for (int i = 0; i < getTable().getItemCount(); i++) {
		provider.updateElement(i);

That comment seems to deserve a // FIXME or something like that, as the VIRTUAL
property is entirely defeated that way. I don't know why it's iterating all
getTable().getItemCount(), but I might add that the List parameter was empty and
reveal was false.

The call stack for this looks like this for me:
	QCProviderForVirtualTableViewer.updateElement(int) line: 108
	TableViewer.virtualSetSelectionToWidget(List, boolean) line: 1151
	TableViewer.setSelectionToWidget(List, boolean) line: 1090
	TableViewer(StructuredViewer).setSelectionToWidget(ISelection, boolean) line: 1494
	TableViewer(StructuredViewer).preservingSelection(Runnable) line: 1208
	TableViewer(StructuredViewer).refresh(Object) line: 1262
	TableViewer(StructuredViewer).refresh() line: 1221
	TableViewer.inputChanged(Object, Object) line: 745
	TableViewer(ContentViewer).setInput(Object) line: 248
	TableViewer(StructuredViewer).setInput(Object) line: 1417
Comment 1 Boris Bokowski CLA 2005-10-24 09:42:56 EDT
See also bug 113472.
Comment 2 Boris Bokowski CLA 2005-10-28 17:18:28 EDT
Fix released for builds >20051028.
Comment 3 Jörg von Frantzius CLA 2005-10-29 16:27:35 EDT
(In reply to comment #2)
> Fix released for builds >20051028.

Doesn't that also fix bug#113472 ?
Comment 4 Boris Bokowski CLA 2005-11-01 13:43:09 EST
[I20051101-0010]
Verified on Windows XP.
Comment 5 Boris Bokowski CLA 2005-11-09 15:45:20 EST
*** Bug 97879 has been marked as a duplicate of this bug. ***