views:

168

answers:

1

Hello. This question may sounds trivial, but i am struggling with the issue, so, please help if u can. So, here it is : i am using a CheckboxTreeViewer for some good reasons. I've google-it for some class usages, and i am currently able to check/uncheck all the childrens of a selected node, and to preserve the selection after a live search with a custom implementation of the StyledCellLabelProvider provider. All good so far. However, so far i am unable to programatically select one or more elements of the tree viewer after i display the widget and call the setInput() method of the viewer.

So, let's assume for instance that the tree will have 10 main nodes, and 5 leafs on node 6. My question is how do i set the checked state of the 3rd leaf?

Thank u.

A: 

Take a look at this: http://akravets.blogspot.com/2009/08/disabling-nodes-in-checkboxtreeviewer.html, might be of some help. It might not be 100% solution to what you are looking for, but I explain how to skip some nodes.

camokatu
Thank u for the reply. Unfortunately, as confirmed by the code founded at the specified link, using a checkboxtreeviewer is way too complicated and fuzzy for my taste. Instead, i have adapted a regular treeviewer to allow various selection modes and i have created a text area to enable search in that tree. The search is performed on the viewer's model and the selection modes are enhanced on the viewer's control, the regular tree. Problem fixed then, and a strong feeling is also with me, to NOT use checkboxtreeviewer again :D. Cheers.
Hypercube