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

Bug 312926

Summary: [DataBinding] TreeViewerUpdater does not rebuild children
Product: [Eclipse Project] Platform Reporter: Matt Biggs <zebbedi>
Component: UIAssignee: Matthew Hall <qualidafial>
Status: RESOLVED FIXED QA Contact: Matthew Hall <qualidafial>
Severity: normal    
Priority: P3 CC: bokowski
Version: 3.5.2   
Target Milestone: 3.7 M2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Patch none

Description Matt Biggs CLA 2010-05-14 11:19:56 EDT
Build Identifier: 20090920-1017

The TreeViewerUpdater does not always rebuild its children when an element is replaced. 

I am using databinding with a tree that has its input as an observeable detail. When the detail changes, the TreeViewerUpdater calls the replace() method to replace the item, and if the TreeViewer.replace() method is used the items children are not re-evaluated after the change. 

This leads to the new item displaying the entries of its previous item in the tree or no children. The +/- also becomes invalid. It also means the IObservableFactory is never called to re-request the new children.

The API for TreeViewer.replace() states it should only be used for a with an SWT.VIRTUAL style. 

I managed to force the TreeViewer updater to remove and insert the item by adding a dummy ViewerFilter to the try and this solved the problem. 

Perhpas TreeViewer.replace() will work if a refresh can be called on the viewer afterwards? I have not tested this however.

Reproducible: Always
Comment 1 Matthew Hall CLA 2010-08-19 01:47:59 EDT
Created attachment 176960 [details]
Patch

Matt, does this fix the problem for you?
Comment 2 Matt Biggs CLA 2010-08-23 04:26:20 EDT
(In reply to comment #1)
> Created an attachment (id=176960) [details]
> Patch
> 
> Matt, does this fix the problem for you?

Matt, thanks, yes this does indeed fix the problem.
Comment 3 Matthew Hall CLA 2010-08-27 01:29:09 EDT
Boris, +1?
Comment 4 Boris Bokowski CLA 2010-08-27 10:49:09 EDT
+1
Comment 5 Matthew Hall CLA 2010-08-31 02:09:10 EDT
Released to HEAD > 20100831