Project: Eclipse_Platform_UI
Bug 207846 [Viewers] Virtual TableViewer setSelection() does not work properly
Reported: 2007-10-29 16:09:49 | Status: resolved fixed

Build ID: 3.3.1.1 Steps To Reproduce: 1. Create a virtual TableViewer 2. Add elements to the table 3. call setSelection() on an item that is not visible The selected item will be revealed. The API contract states that for the selection to be revealed, you must call setSelection(item, true). More information: I'm setting this to blocker because I have code that extends TableViewer that allows me to keep track of a virtual selection and when new elements are added to the table as the user scrolls that are part of the virtual selection, I update the underlying actual selection. This causes the table to jump back to the start of the selection making the table unusable. I have no workaround for this problem, and thus it's blocking me from delivering required functionality to my customers. Looking at the code, it appears that the virtual table viewer calls setSelection() on the underlying SWT Table which in turn calls showIndex() - whereas a non virtual table viewer calls Table select() which does not call showIndex(). Can the virtual table use select() instead of setSelection()?

Files changed in fix:
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/AbstractTableViewer.java