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

Bug 342596

Summary: After Tableviewer#remove(Object) refresh brings back the removed object
Product: [Eclipse Project] Platform Reporter: Artur Kronenberg <artur.kronenberg>
Component: UIAssignee: Platform-UI-Inbox <Platform-UI-Inbox>
Status: CLOSED INVALID QA Contact:
Severity: major    
Priority: P3 CC: tom.schindl
Version: 3.6.2   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
RCP project with tableviewer and remove functionality none

Description Artur Kronenberg CLA 2011-04-12 11:27:20 EDT
Created attachment 193057 [details]
RCP project with tableviewer and remove functionality

Hi,

When using JFace TableViewer and calling TableViewer#remove on an object in the viewer, the object is removed from the view.

However, when calling refresh, the removed objects reappear in the view.

I guess this is a bug. If I am mistaken, how can I remove objects permanently? (preferably without resetting the whole input on my viewer)

I ran into that problem when using Comparators on my viewer. I resorted the input by calling refresh on my viewer and saw my deleted items reappear. 

I created a small RCP project with a view and a remove button to show the problem. 

If you'd like to reproduce it by yourself, you can create a TableViewer and simply call TableViewer#remove(object) and TableViewer#refresh(). 

Kind regards,

-- artur
Comment 1 Thomas Schindl CLA 2011-04-12 11:35:17 EDT
No. TableViewer#remove() does not remove it from the input. You also have to remove it from your input-Instance.