Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 344566 - [Viewers] SelectionProvider on SWT.Virtual TableViewer propagets wrong value when items have been replaced
Summary: [Viewers] SelectionProvider on SWT.Virtual TableViewer propagets wrong value ...
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-03 09:30 EDT by Artur Kronenberg CLA
Modified: 2020-07-18 13:42 EDT (History)
1 user (show)

See Also:


Attachments
Sample rpc to display print the current selection and replace an element. (23.71 KB, application/zip)
2011-05-03 09:30 EDT, Artur Kronenberg CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Artur Kronenberg CLA 2011-05-03 09:30:25 EDT
Created attachment 194577 [details]
Sample rpc to display print the current selection and replace an element.

Hi,

I am using a virtual TableViewer. During runtime of the program some elements are being changed by the user. These changes are made by getting the index of the element in my viewer and calling replace. I also manipulate the content provider to have the model synchronized with the view.

It seems however that the virtual manager does not refresh its cached elements when replacing. Debugging the SelectionProvider of the tableviewer shows that it is retrieving the wrong element from the virtual manager. 

Is there something I got wrong when using replace? I can't find a different way to replace the models except for calling setInput which would kill my performance. 

TableViewer#refresh() will fix the problem because the virtual manager is refreshing its cached elements. 

I think that this a bug since creating the viewer without the virtual flag will fix the problem. 

I created a sample off the RCP with a view example to demonstrate. I register a listener to the selectionService of the workbench and print out the selection. A button is replacing the second element. When clicking on it again you'll see that the selection is retrieving the wrong element. (see attachment)

kind regards,

-- artur
Comment 1 Eclipse Genie CLA 2020-07-18 13:42:06 EDT
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.