Bug 156537 [Viewers] Virtual tree viewer does not populate with initial children
I20060830-1650 When a tree viewer is created with the SWT.Vitrual flag and uses an ILazyTreeContentProvider, the viewew does not populate with the initial children in the model. The method TreeViewer.createChildren(Widget) only updates existing items if the parent (root)element has been mapped to data, and does not query the content provider for the number of children it has. Attached is a sample plug-in showing the problem. The tree "model" looks like this: root one two three When the input is set to the viewer ("root") a call is made to "createChildren", but the content provider is never used.
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/AbstractTreeViewer.java
return result;
	}
	/**
	 * Adds the given child element to this viewer as a child of the given
	 * parent element. If this viewer does not have a sorter, the element is
	 * added at the end of the parent's list of children; otherwise, the element
	 * is inserted at the appropriate position.
	 * <p>
	 * This method should be called (by the content provider) when a single
	 * element has been added to the model, in order to cause the viewer to
	 * accurately reflect the model. This method only affects the viewer, not
	 * the model. Note that there is another method for efficiently processing
	 * the simultaneous addition of multiple elements.
	 * </p>
	 * 
	 * @param parentElementOrTreePath
	 *            the parent element or path
	 * @param childElement
	 *            the child element
	 */
	public void add(Object parentElementOrTreePath, Object childElement) {
		add(parentElementOrTreePath, new Object[] { childElement });
	}
	/**
	 * Adds the given SWT selection listener to the given SWT control.
	 * 
	 * @param control
	 *            the SWT control
	 * @param listener
	 *            the SWT selection listener