Community
Participate
Working Groups
Build Identifier: M20110210-1200 I have noticed that both in my code and the sample code for ILazyTreeContentProvider in Snippet047VirtualLazyTreeViewer, CheckboxTreeViewer behaves incorrectly when using ILazyTreeContentProvider and SWT.VIRTUAL flag. Since I am sure the Eclipse team is aware of that I would ask- 1. To document this fact in the CheckboxTreeViewer documentation. 2. Support ILazyTreeContentProvider and SWT.VIRTUAL for CheckboxTreeViewer. Reproducible: Always Steps to Reproduce: 1. Open Snippet047VirtualLazyTreeViewer from the SWT samples. 2. Replace new TreeViewer() with new ChecboxTreeViewer(). 3. Note that when expanding the tree, only 1 child is shown for each node, instead of 100.
And what is even worse is that when changing the TreeViewer to CheckboxTreeViewer ([1]) in the sample code [2], it leads to a StackOverflowError. Here's a complete stack trace which shows that updateElement, updateChildCount, etc. methods are called until a StackOverflowError occurs: http://i.imgur.com/EPBoJeg.png If you complement the code with setting a custom check state provider for the CheckboxTreeViewer, it solves the problem: <code> <pre> v.setCheckStateProvider(new ICheckStateProvider() { /** * TODO: provide complete solution if checkboxes are really needed */ @Override public boolean isGrayed(Object element) { return false; } /** * TODO: provide complete solution if checkboxes are really needed */ @Override public boolean isChecked(Object element) { return false; } }); </pre> </code> [1]: http://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fjface%2Fviewers%2FCheckboxTreeViewer.html [2]: https://github.com/vogella/eclipse.platform.ui/blob/master/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet047VirtualLazyTreeViewer.java#L132
Just tried this with Eclipse Oxygen 4.7 on 2017-07-06: This problem still exists today. :-( Luckily the solution works for me, too.
Duplicate of bug 58848 from 2004. Still open. https://bugs.eclipse.org/bugs/show_bug.cgi?id=58848
https://wiki.eclipse.org/Platform_UI/How_to_Contribute *** This bug has been marked as a duplicate of bug 58848 ***