Bug 207846 [Viewers] Virtual TableViewer setSelection() does not work properly
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()?
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/AbstractTableViewer.java
/**
	 * Create a new row.  Callers can only use the returned object locally and before
	 * making the next call on the viewer since it may be re-used for subsequent method
	 * calls.
	 *
	 * @param style
	 *            the style for the new row
	 * @param rowIndex
	 *            the index of the row or -1 if the row is appended at the end
	 * @return the newly created row
	 */
	protected abstract ViewerRow internalCreateNewRowPart(int style,
			int rowIndex);
	/**
	 * Adds the given element to this table viewer. If this viewer does not have
	 * a sorter, the element is added at the end; otherwise the element is
	 * inserted at the appropriate position.
	 * <p>
	 * This method should be called (by the content provider) when a single
	 * element has been added to the model, in order to cause the viewer to
	 * accurately reflect the model. This method only affects the viewer, not
	 * the model. Note that there is another method for efficiently processing
	 * the simultaneous addition of multiple elements.
	 * </p>
	 *
	 * @param element
	 *            the element to add
	 */
	public void add(Object element) {
		add(new Object[] { element });