Bug 153993 [Viewers] Common Baseclass for Tree/TableEditorImpl
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TreeViewer.java
* @param widget
	 * @param element
	 */
	private void virtualRefreshChildCounts(Widget widget, Object element) {
		if (widget instanceof Tree || ((TreeItem) widget).getExpanded()) {
			
			if (element != null) {
				virtualLazyUpdateChildCount(widget, getChildren(widget).length);
			} else {
				if (widget instanceof Tree) {
					((Tree) widget).setItemCount(0);
				} else {
					((TreeItem) widget).setItemCount(0);
				}
			}
			
			
			Item[] items = getChildren(widget);
			for (int i = 0; i < items.length; i++) {
				Item item = items[i];
				Object data = item.getData();
				if (data != null) {
					virtualRefreshChildCounts(item, data);
				}
			}
		}
	}
	/*
	 * To unmap elements correctly, we need to register a dispose listener with
	 * the item if the tree is virtual.