Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 312926 - [DataBinding] TreeViewerUpdater does not rebuild children
Summary: [DataBinding] TreeViewerUpdater does not rebuild children
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.7 M2   Edit
Assignee: Matthew Hall CLA
QA Contact: Matthew Hall CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-14 11:19 EDT by Matt Biggs CLA
Modified: 2010-08-31 02:09 EDT (History)
1 user (show)

See Also:


Attachments
Patch (904 bytes, patch)
2010-08-19 01:47 EDT, Matthew Hall CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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