Project: Eclipse_Platform_UI
Bug 187762 [FilteredTree] clear icon fails to appear on FilteredTree if expand time gets maxed
Reported: 2007-05-18 03:37:02 | Status: verified fixed

On line 362 of FilteredTree the code is: if (text.length() > 0 && !initial) { /* Expand elements one at a time. After each is expanded, check * to see if the filter text has been modified. If it has, then * cancel the refresh job so the user doesn't have to endure * expansion of all the nodes. */ TreeItem[] items = getViewer().getTree().getItems(); int treeHeight = getViewer().getTree().getBounds().height; int numVisibleItems = treeHeight / getViewer().getTree().getItemHeight(); long stopTime = SOFT_MAX_EXPAND_TIME + System.currentTimeMillis(); if (items.length > 0 && recursiveExpand(items, monitor, stopTime, new int[] { numVisibleItems })) { return Status.CANCEL_STATUS; } // enabled toolbar - there is text to clear // and the list is currently being filtered updateToolbar(true); It looks like updateToolbar(true) is not getting called if the stopTime is reached. This means that the clear icon does not show up, which is confusing. I moved the updateToolbar(true) call above the expansion stuff and things worked as expected, because code below this will remove the icon when the text gets cleared.

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/FilteredTree.java