| Summary: | [Viewers] Setting VIRTUAL TableViewer's input results in all TableItems being created | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Jörg von Frantzius <jfrantzius> |
| Component: | UI | Assignee: | 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: | |||
See also bug 113472. Fix released for builds >20051028. (In reply to comment #2) > Fix released for builds >20051028. Doesn't that also fix bug#113472 ? [I20051101-0010] Verified on Windows XP. |
[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