Bug 90389 [Model] Can WorkbenchContentProvider:273 invoke Tree.setRedraw(boolean) less?
3.1M6, note that this is most visually apparent on motif - open a CVS Repositories view in the Resource perspective - connect to dev.eclipse.org - somewhat quickly: - begin retrieving the org.eclipse.swt project from HEAD - click "Run in Background" - switch to the Navigator view, and the org.eclipse.swt project will be there - expand its top level only, and its only folder child so far should be Eclipse SWT, which takes a while to travel from CVS - if you watch it you'll notice the tree flash a few times, though nothing visually changes in it (not even its vertical scrollbar) This is happening because WorkbenchContentProvider is invoking setRedraw(false) and then setRedraw(true) often without invoking any methods on Tree in between. This causes flash because the Tree needs to do a full redraw whenever it receives setRedraw(true); if nothing has happened since setRedraw(false) then this is an unnecessary redraw(), which is the cause of the flash. Is it possible for WorkbenchContentProvider to somehow determine the nature of the work it's going to do between the setRedraw() invocations and choose to not invoke setRedraw() if appropriate?
bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/model/WorkbenchContentProvider.java
if (addedChildren.length > 0) {
			addedObjects = new Object[addedChildren.length];
			for (int i = 0; i < addedChildren.length; i++)
				addedObjects[i] = addedChildren[i].getResource();
		} else
			addedObjects = new Object[0];
		
		if (removedChildren.length > 0) {
			removedObjects = new Object[removedChildren.length];
			for (int i = 0; i < removedChildren.length; i++)
				removedObjects[i] = removedChildren[i].getResource();
		} else
			removedObjects = new Object[0];
		
		Runnable addAndRemove = new Runnable(){
			/* (non-Javadoc)
			 * @see java.lang.Runnable#run()
			 */
			public void run() {
				
				
				
				
				
				viewer.getControl().setRedraw(false);
				try {
					if (viewer instanceof AbstractTreeViewer) {
						AbstractTreeViewer treeViewer = (AbstractTreeViewer) viewer;
						if (addedObjects.length > 0)
							treeViewer.add(resource, addedObjects);