Bug 181308 [Viewers] Add checked state provider to CheckBox*Viewer
It would be nice to have a provider (similar to the label or font or color providers) to determine the checked/grayed state of elements in a CheckBox*Viewer (either Table or Tree). This would generally simplify the programming model and give the developer better control over how the model objects are displayed in the viewer.
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/CheckboxTreeViewer.java
* Only listeners registered at the time this method is called are notified.
     *
     * @param event a check state changed event
     *
     * @see ICheckStateListener#checkStateChanged
     */
    protected void fireCheckStateChanged(final CheckStateChangedEvent event) {
        Object[] array = checkStateListeners.getListeners();
        for (int i = 0; i < array.length; i++) {
            final ICheckStateListener l = (ICheckStateListener) array[i];
            SafeRunnable.run(new SafeRunnable() {
                public void run() {
                    l.checkStateChanged(event);
                }
            });
        }
    }
    /**
     * Gathers the checked and grayed states of the given widget and its
     * descendents.
     *
     * @param checked a writable set of elements (element type: <code>Object</code>) 
     * @param grayed a writable set of elements (element type: <code>Object</code>) 
     * @param widget the widget
     */
    private void gatherState(CustomHashtable checked, CustomHashtable grayed,
            Widget widget) {
        Item[] items = getChildren(widget);
        for (int i = 0; i < items.length; i++) {
            Item item = items[i];