Bug 141435 - [Viewers] ListViewer without a selection loses scrolled state when refreshed
Summary: [Viewers] ListViewer without a selection loses scrolled state when refreshed
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3 M3   Edit
Assignee: Boris Bokowski CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2006-05-11 17:05 EDT by Brad Reynolds CLA
Modified: 2006-09-26 12:22 EDT (History)
1 user (show)

See Also:


Attachments
JUnit showing the issue (3.39 KB, text/plain)
2006-05-11 17:06 EDT, Brad Reynolds CLA
no flags Details
Patch for AbstractListViewer and ListViewer (3.13 KB, patch)
2006-05-13 14:03 EDT, Brad Reynolds CLA
no flags Details | Diff
Patch for ListViewerTest (1.74 KB, patch)
2006-05-13 14:04 EDT, Brad Reynolds CLA
no flags Details | Diff
combined patch (11.17 KB, patch)
2006-09-26 12:19 EDT, Boris Bokowski CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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!