CheckboxTreeViewer allows you to check only one item

How to force a class CheckboxTreeViewerto allow only one checked item? I could not find a style that would apply this behavior.

The only alternative I have to do is to capture the validation event and uncheck other elements

+4
source share
1 answer

SWT.SINGLE AND SWT.MULTI style bits refer to single or multiple selections in a list, tree, and tables.

But AFAIK you need to use addCheckStateListener and first deselect all the elements and then switch the check state of the current element.

+2

All Articles