Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 366738

Summary: [TableViewer] VIRTUAL tableviewer resets selection after cell-editing
Product: [Eclipse Project] Platform Reporter: Rüdiger Herrmann <ruediger.herrmann>
Component: UIAssignee: Platform-UI-Inbox <Platform-UI-Inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: broy2, ivan
Version: 3.7.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug
Bug Depends on:    
Bug Blocks: 366385    
Attachments:
Description Flags
Snippet to reproduce the bug none

Description Rüdiger Herrmann CLA 2011-12-14 13:14:59 EST
Build Identifier: master

After cell-editing that spanned several rows, the table viewer resets the selection to the row where editing was started. This can be observed only with a TableViewer that is backed by a VIRTUAL table, with non-VIRTUAL tables the behavior is as expected.

Steps to Reproduce:
1. Run the attached TableViewerBug class
2. activate the cell editor in the fist row, first column
3. press Tab until you reach the 3rd row
4. press Esc to deactivate the cell editor
5. press the Down key
Expected result: row 4 gets selected
Actual result: row 2 gets selected

I suggest to change the selection-code in AbstractTableViewer#virtualSetSelectionToWidget() to be equivalent to the code from setSelectionToWidget(). There, doSetSelection() (instead of doSelect) is used to select items as this method also moves to focused item with the selection. The focused item in turn determines where keyboard navigation starts from.
Comment 1 Rüdiger Herrmann CLA 2011-12-14 13:19:59 EST
Created attachment 208398 [details]
Snippet to reproduce the bug
Comment 2 Matt Heitz CLA 2012-11-12 13:25:17 EST
*** Bug 358669 has been marked as a duplicate of this bug. ***
Comment 3 Eclipse Genie CLA 2020-01-28 16:45:29 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. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. 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.

--
The automated Eclipse Genie.