Bug 159918 [Viewers] TreeViewer.setChildCount(...) should preserve selection
Since changing the child count of an element in a tree can effectively remove children, the #setChildCount(...) method should preserve selection. This way if a selected item is disposed, the selection change will fire with the new <empty selection>.
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TreeViewer.java
clearColumnParts();
		super.setLabelProvider(labelProvider);
	}
	/**
	 * Clear the viewer parts for the columns
	 */
	private void clearColumnParts() {
		TreeColumn[] columns = getTree().getColumns();
		if (columns.length == 0)
			getTree().setData(ViewerColumn.COLUMN_VIEWER_KEY, null);
		else {
			for (int i = 0; i < columns.length; i++) {
				columns[i].setData(ViewerColumn.COLUMN_VIEWER_KEY, null);
			}
		}
	}
	/*
	 * (non-Javadoc) Method declared in AbstractTreeViewer.
	 */
	protected void setSelection(List items) {
		Item[] current = getSelection(getTree());
		
		if (isSameSelection(items, current)) {
			return;
		}
		TreeItem[] newItems = new TreeItem[items.size()];
		items.toArray(newItems);
		getTree().setSelection(newItems);
	}
	/**