Bug 319600 [Viewers] CheckboxTableViewer.getCheckedElements based on virtual table returns null data objects
Build Identifier: 20100617-1415 If programmatically select all rows in CheckboxTableViewer created upon virtual table using setAllChecked, then getCheckedElements method returns null data objects, probably, for non-displayed rows. In spite of the fact, that table is virtual, it is expected that getCheckedElements returns concrete non-null data objects associated with rows. Reproducible: Always Steps to Reproduce: 1. Launch attached snippet. 2. Click "Select/Deselect All" to select all rows, then click "Null Rows" and message with number of rows with null data objects will be displayed.
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/CheckboxTableViewer.java
if (item.getChecked() != check) {
                    item.setChecked(check);
                }
            }
        }
    }
    /**
     * Sets the grayed state for the given element in this viewer.
     *
     * @param element the element
     * @param state <code>true</code> if the item should be grayed,
     *  and <code>false</code> if it should be ungrayed
     * @return <code>true</code> if the element is visible and the gray
     *  state could be set, and <code>false</code> otherwise
     */
    public boolean setGrayed(Object element, boolean state) {
        Assert.isNotNull(element);
        Widget widget = findItem(element);
		if (widget instanceof TableItem) {
			TableItem item = (TableItem) widget;
			if (item.getGrayed() != state)
				item.setGrayed(state);
			return true;
		}
        return false;
    }
    /**
     * Sets which nodes are grayed in this viewer.
     * The given list contains the elements that are to be grayed;
     * all other nodes are to be ungrayed.