Bug 270457 [Viewers] [regression] CheckBoxTreeViewer clears check state after collapseAll
Hi there :) In my RCP I've a CheckBoxTreeViewer that looses check states for invisible items. Turns out if a disable the collapseAll() call things go back to normal. So, in a tree like this: [x] root [x] sub a collapseAll expandAll will create this: [x] root [] sub Could still be my fault, feel free to have me try some workarounds or other tests that help you find the cause...
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/CheckboxTreeViewer.java
internalCollectGrayed(result, getControl());
        return result.toArray();
    }
    /* (non-Javadoc)
     * Method declared on StructuredViewer.
     */
    protected void handleDoubleSelect(SelectionEvent event) {
        if (lastClickedItem != null) {
            TreeItem item = lastClickedItem;
            Object data = item.getData();
            if (data != null) {
                boolean state = item.getChecked();
                setChecked(data, !state);
                fireCheckStateChanged(new CheckStateChangedEvent(this, data,
                        !state));
            }
            lastClickedItem = null;
        } else {
			super.handleDoubleSelect(event);
		}
    }
    /* (non-Javadoc)
     * Method declared on StructuredViewer.
     */
    protected void handleSelect(SelectionEvent event) {
        lastClickedItem = null;
        if (event.detail == SWT.CHECK) {
            TreeItem item = (TreeItem) event.item;
            lastClickedItem = item;
            super.handleSelect(event);