Bug 156544 [Viewers] Vitrual lazy tree viewer - refreshing a node does not make it expandable
I20060830-1650 Using a tree viewer with the SWT.Vitrual style and an ILazyTreeContentProvider. If a node in a tree has no children in an underlying model, and then has children added to that node, calling refresh no the corresponding element does not add a "+" to the tree node. The code that does not consult the content provider for an element's child count if a tree item already has data mapped to it. Attatched is a sample plug-in showing the problem. The model changes from: root one two three to: root one a b c two three ... but the content provider is not consulted when calling refresh on "one". To see the problem, open the sample view, and invoke "Update Model" action from the context menu.
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TreeViewer.java
getControl().update();
		}
	}
	/**
	 * The tree viewer implementation of this <code>Viewer</code> framework
	 * method ensures that the given label provider is an instance of either
	 * <code>ITableLabelProvider</code> or <code>ILabelProvider</code>.
	 * <p>
	 * If the label provider is an {@link ITableLabelProvider}, then it
	 * provides a separate label text and image for each column. Implementers of
	 * <code>ITableLabelProvider</code> may also implement
	 * {@link ITableColorProvider} and/or {@link ITableFontProvider} to provide
	 * colors and/or fonts. Note that the underlying {@link Tree} must be
	 * configured with {@link TreeColumn} objects in this case.
	 * </p>
	 * <p>
	 * If the label provider is an <code>ILabelProvider</code>, then it
	 * provides only the label text and image for the first column, and any
	 * remaining columns are blank. Implementers of <code>ILabelProvider</code>
	 * may also implement {@link IColorProvider} and/or {@link IFontProvider} to
	 * provide colors and/or fonts.
	 * </p>
	 */
	public void setLabelProvider(IBaseLabelProvider labelProvider) {
		Assert.isTrue(labelProvider instanceof ITableLabelProvider
				|| labelProvider instanceof ILabelProvider);
		clearColumnParts();
		super.setLabelProvider(labelProvider);