Bug 396604 - [Viewers] TableViewer with virtual style doesn't preserve selection unless you create it with SWT.FULL_SELECTION
Summary: [Viewers] TableViewer with virtual style doesn't preserve selection unless yo...
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7.2   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-14 07:14 EST by Jan Krakora CLA
Modified: 2019-11-27 07:39 EST (History)
1 user (show)

See Also:


Attachments
Runnable snippet to reproduce the problem (2.06 KB, application/octet-stream)
2012-12-14 07:14 EST, Jan Krakora CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Krakora CLA 2012-12-14 07:14:12 EST
Created attachment 224729 [details]
Runnable snippet to reproduce the problem

Steps To Reproduce:
1. Create virtual TableViewer with ArrayContentProvider.
2. Set ArrayList<String> containing few elements as its input.
3. Select an element.
4. Add another element at the beginning of the input list and refresh the viewer.

You will see that selection is at the same index, although it should move down with the previous selected element.

If you create the TableViewer with SWT.FULL_SELECTION, it works fine i.e. the selection stays on the selected element and selectionChangedEvent is not being fired.

I am attaching a stand alone java file TestCase that has the code snippet to recreate this problem.
Comment 1 Guillaume Galliano Bondurand CLA 2012-12-14 08:08:24 EST
With Version 3.7.2 and Windows XP Pro Service Pack 3 the selection is never preserved even with the SWT.FULL_SELECTION style.
Comment 2 Lars Vogel CLA 2019-11-27 07:39:16 EST
This bug hasn't had any activity in quite some time. Maybe the problem got
resolved, was a duplicate of something else, or became less pressing for some
reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it.
The information can be, for example, that the problem still occurs, that you
still want the feature, that more information is needed, or that the bug is
(for whatever reason) no longer relevant.

If the bug is still relevant, please remove the stalebug whiteboard tag.