Bug 141435

Summary: [Viewers] ListViewer without a selection loses scrolled state when refreshed
Product: [Eclipse Project] Platform Reporter: Brad Reynolds <bradleyjames>
Component: UIAssignee: Boris Bokowski <bokowski>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Tod_Creasey
Version: 3.1.2Keywords: contributed
Target Milestone: 3.3 M3   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
JUnit showing the issue
none
Patch for AbstractListViewer and ListViewer
none
Patch for ListViewerTest
none
combined patch none

Description Brad Reynolds CLA 2006-05-11 17:05:08 EDT
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.
Comment 1 Brad Reynolds CLA 2006-05-11 17:06:15 EDT
Created attachment 41233 [details]
JUnit showing the issue
Comment 2 Brad Reynolds CLA 2006-05-13 14:03:38 EDT
Created attachment 41406 [details]
Patch for AbstractListViewer and ListViewer

Added hooks to retrieve the top index before refresh and to restore the top index after refresh.
Comment 3 Brad Reynolds CLA 2006-05-13 14:04:42 EDT
Created attachment 41407 [details]
Patch for ListViewerTest
Comment 4 Brad Reynolds CLA 2006-05-13 14:06:13 EDT
The existing tests for ComboViewer succeed with the patch.
Comment 5 Boris Bokowski CLA 2006-09-26 12:19:38 EDT
Created attachment 50920 [details]
combined patch

This is one patch combining all three previous attachments, with added contribution comments.
Comment 6 Boris Bokowski CLA 2006-09-26 12:22:03 EDT
Released >20060926. Thanks!