Bug 32254 [Viewers] AbstractTreeViewer uses HashSet to remember expansion state
I20030216 The custom hash table should be used instead. Otherwise expansion state may be lost due to a different equals implementation of the element and the IElementComparer.
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/CheckboxTreeViewer.java
}
}
/**
 * Sets the grayed state of all items to correspond to the given set of grayed elements.
 *
 * @param grayedElements the set (element type: <code>Object</code>) of elements which are grayed
 * @param widget the widget
 */
private void internalSetGrayed(Set grayedElements, Widget widget) {
	Item[] items = getChildren(widget);
	for (int i = 0; i < items.length; i++) {
		TreeItem item = (TreeItem) items[i];
		Object data = item.getData();
		if (data != null) {
			boolean grayed = grayedElements.contains(data);
			if (grayed != item.getGrayed()) {
				item.setGrayed(grayed);
			}
		}
		internalSetGrayed(grayedElements, item);
	}
}
/* (non-Javadoc)
 * Method declared on Viewer.
 */
protected void preservingSelection(Runnable updateCode) {
	int n = getItemCount(getControl());
	Set checkedNodes = new HashSet(n);
	Set grayedNodes = new HashSet(n);
	gatherState(checkedNodes, grayedNodes, getControl());