Bug 103747 [Viewers] calling refresh on treeviewer in treeExpanded function, but it mess
I tried calling refresh on treeviewer in treeExpanded function. The result is it mess up the tree, there is only one children without a label. Code to reproduce: public void createPartControl(Composite parent) { viewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); drillDownAdapter = new DrillDownAdapter(viewer); viewer.setContentProvider(new ViewContentProvider()); viewer.setLabelProvider(new ViewLabelProvider()); viewer.setSorter(new NameSorter()); viewer.setInput(getViewSite()); viewer.addTreeListener(new ITreeViewerListener() { public void treeCollapsed(TreeExpansionEvent event) { } public void treeExpanded(TreeExpansionEvent event) { viewer.refresh(event.getElement()); }}); }
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/AbstractTreeViewer.java
}
	/**
	 * Return whether the given element is expandable.
	 * 
	 * @param item
	 *            the tree item for the element
	 * @param parentPath
	 *            the parent path if it is known or <code>null</code> if it
	 *            needs to be determines
	 * @param element
	 *            the element
	 * @return whether the given element is expandable
	 */
	private boolean isExpandable(Item item, TreePath parentPath, Object element) {
		Object elementOrTreePath = element;
		if (isTreePathContentProvider()) {
			if (parentPath != null) {
				elementOrTreePath = parentPath.createChildPath(element);
			} else {
				elementOrTreePath = getTreePathFromItem(item);
			}
		}
		return isExpandable(elementOrTreePath);
	}
	
	protected void labelProviderChanged() {
		
		Control tree = getControl();
		tree.setRedraw(false);