| Summary: | [Viewers] Virtual tree viewer does not populate with initial children | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Darin Wright <darin.eclipse> | ||||||
| Component: | UI | Assignee: | Boris Bokowski <bokowski> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | bokowski, ivo.abadjiev, tom.schindl | ||||||
| Version: | 3.3 | ||||||||
| Target Milestone: | 3.3 M2 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows XP | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
Created attachment 49626 [details]
sample project
Open the "Sample View" to see the problem.
Workaround: If I add a call to "refresh()" the view after setting the input, then the initial children are displayed. Fixed >20060911. Forgot to mark as fixed. Immediate children of the root appear, but initial children at the second level do not appear. Modified example to populate the model with:
root
one
a
b
c
two
three
When I create the viewer and set the input, only "one, two, three" appear and there is no "+" sign beside "one" as there should be.
Created attachment 49939 [details]
modified sample project
Note: you can use the context menu to "Refresh 'one'", which makes the "+" appear - but the children are already in the model. I noticed that your content provider does not call TreeViewer.setChildCount(). I believe this is working as designed, but please reopen if I'm wrong. Marking as fixed again. The same behavior with M20060921-0945 (3.2.1) TreeViewer created with SWT.VIRTUAL flag and set to use ILazyTreeContentProvider does not populate root/input children if "TreeViewer.setChildCount" or "TreeViewer.refresh" is not called after "TreeViewersetInput" is called. The right behavior would be TreeView to call "updateChildCount" of ILazyTreeContentProvider as it is documented for ILazyTreeContentProvider#updateChildCount method. |
I20060830-1650 When a tree viewer is created with the SWT.Vitrual flag and uses an ILazyTreeContentProvider, the viewew does not populate with the initial children in the model. The method TreeViewer.createChildren(Widget) only updates existing items if the parent (root)element has been mapped to data, and does not query the content provider for the number of children it has. Attached is a sample plug-in showing the problem. The tree "model" looks like this: root one two three When the input is set to the viewer ("root") a call is made to "createChildren", but the content provider is never used.