Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 344551 - [Viewers] ViewerComparator on Virtual Table breaks TableViewer#add()
Summary: [Viewers] ViewerComparator on Virtual Table breaks TableViewer#add()
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 06:31 EDT by Artur Kronenberg CLA
Modified: 2019-10-10 13:35 EDT (History)
2 users (show)

See Also:


Attachments
Snippet for virtual table viewer with add and refresh button (4.01 KB, text/x-java)
2011-05-03 06:31 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 06:31:45 EDT
Created attachment 194561 [details]
Snippet for virtual table viewer with add and refresh button

Hi,

In my project I found that on add, a virtual table seems to break. It still adds elements to the table view, however it adds the wrong ones. 
this is a somewhat more detailed description (I'll attach code at the end) :

Create a table viewer that is virtual and add a comparator to it. Then add elements that would appear at the beginning of the Viewer. When calling add, the tableviewer adds a new element, but since it is adding it to the end, it retrieves the last element of the model. Due to the sorting of the model, the newly added element isn't at the end and the wrong element is added to the view.

This seems to be an indexing problem with the viewer. The correct element is created and calling refresh on the viewer will make everything appear in the right way. 

I used Tom's TableViewer sorter and changed the code so the UI has an add and a refresh method. Calling add will add elements that start with the index 1. The comparator will put them on top of the viewer and they won't be visible. After clicking refresh, everything works fine. 

Best regards,

-- artur
Comment 1 Eclipse Genie CLA 2019-10-10 13:35:26 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.

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.

--
The automated Eclipse Genie.