Bug 150805 [Import/Export] Incomplete validation when importing from directory
The following instance methods of CheckboxTreeViewer class don't fire any CheckStateChangedEvent. Affected methods: setAllChecked(...) setCheckedElements(...) setChecked(...) Steps to reproduce the bug: 1. File -> Import... 2. File System -> Next 3. Choose a "From directory" using the Browse... button 4. Check the root element from the left pane (the error message saying that "There are no resources currently selected for import." should disappear) 5. Press the Deselect All button and see that no error message is displayed at all!! 6. Recheck the root element twice and the error message is displayed again!! Solution: Add fireCheckStateChanged calls inside affected methods
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/CheckboxTreeViewer.java
/**
     * Check and gray the selection rather than calling both
     * setGrayed and setChecked as an optimization.
     * @param element the item being checked
     * @param state a boolean indicating selection or deselection
     * @return boolean indicating success or failure.
     */
    public boolean setGrayChecked(Object element, boolean state) {
        Assert.isNotNull(element);
        Widget widget = internalExpand(element, false);
        if (widget instanceof TreeItem) {
            TreeItem item = (TreeItem) widget;
            item.setChecked(state);
            item.setGrayed(state);
            return true;
        }
        return false;
    }
    /**
     * Sets which elements are grayed in this viewer's tree.
     * The given list contains the elements that are to be grayed;
     * all other elements are to be ungrayed.
     * <p>
     * This method is typically used when restoring the interesting
     * state of a viewer captured by an earlier call to <code>getGrayedElements</code>.
     * </p>
     *
     * @param elements the array of grayed elements
     *
     * @see #getGrayedElements