Project: Eclipse_Platform_UI
Bug 141435 [Viewers] ListViewer without a selection loses scrolled state when refreshed
Reported: 2006-05-11 17:05:08 | Status: resolved fixed

When the ListViewer does not contain a selection and is refreshed it loses its vertically scrolled to position. This is because AbstractListViewer removes all items and adds them back (it has to) when a refresh occurs. This is remedied in the use cases where there is a selection because the selected item is revealed after the refresh occurs. Without a selection no reveal can occur therefore it loses its position.

Files changed in fix:
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/AbstractListViewer.java bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ListViewer.java tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/AllTests.java tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/ListViewerRefreshTest.java tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/ListViewerTest.java