From bc80d24e10300174eb015d7251798e0fdb4f60d4 Mon Sep 17 00:00:00 2001 From: Patrick Ziegler Date: Fri, 31 Jan 2025 07:02:05 +0100 Subject: [PATCH] Undeprecate updateToolbar() in FilteredTree and call again on refresh This partially reverts 3726516c0ab381d3d29e24e412f73679e830aba2 due to which the updateToolbar() method is no longer called by the default refresh job. Subclasses may override updateToolbar() without also overriding doCreateRefreshJob() which in return means that their toolbar is not updated anymore. Because this method is called again, the deprecation tag introduced with 176f5030b1ed724274f88552b8bec14e43111832 is also removed --- .../eclipse/e4/ui/dialogs/filteredtree/FilteredTree.java | 9 +++++---- .../eclipseui/org/eclipse/ui/dialogs/FilteredTree.java | 7 +++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/bundles/org.eclipse.e4.ui.dialogs/src/org/eclipse/e4/ui/dialogs/filteredtree/FilteredTree.java b/bundles/org.eclipse.e4.ui.dialogs/src/org/eclipse/e4/ui/dialogs/filteredtree/FilteredTree.java index dab531baaaf..0fbff270da2 100644 --- a/bundles/org.eclipse.e4.ui.dialogs/src/org/eclipse/e4/ui/dialogs/filteredtree/FilteredTree.java +++ b/bundles/org.eclipse.e4.ui.dialogs/src/org/eclipse/e4/ui/dialogs/filteredtree/FilteredTree.java @@ -259,10 +259,15 @@ public IStatus runInUIThread(IProgressMonitor monitor) { int treeHeight = getViewer().getTree().getBounds().height; int numVisibleItems = treeHeight / getViewer().getTree().getItemHeight(); long stopTime = SOFT_MAX_EXPAND_TIME + System.currentTimeMillis(); + + updateToolbar(true); + if (items.length > 0 && recursiveExpand(items, monitor, stopTime, new int[] { numVisibleItems })) { return Status.CANCEL_STATUS; } + } else { + updateToolbar(false); } } finally { // done updating the tree - set redraw back to true @@ -310,10 +315,6 @@ private boolean recursiveExpand(TreeItem[] items, IProgressMonitor monitor, long }; } - /** - * @deprecated As of 4.13 not used anymore - */ - @Deprecated(since = "2025-03", forRemoval = true) protected void updateToolbar(boolean visible) { // nothing to do } diff --git a/bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/dialogs/FilteredTree.java b/bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/dialogs/FilteredTree.java index f41a283ee63..092fb0f038b 100644 --- a/bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/dialogs/FilteredTree.java +++ b/bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/dialogs/FilteredTree.java @@ -430,10 +430,15 @@ public IStatus runInUIThread(IProgressMonitor monitor) { int treeHeight = getViewer().getTree().getBounds().height; int numVisibleItems = treeHeight / getViewer().getTree().getItemHeight(); long stopTime = SOFT_MAX_EXPAND_TIME + System.currentTimeMillis(); + + updateToolbar(true); + if (items.length > 0 && recursiveExpand(items, monitor, stopTime, new int[] { numVisibleItems })) { return Status.CANCEL_STATUS; } + } else { + updateToolbar(false); } } finally { // done updating the tree - set redraw back to true @@ -488,9 +493,7 @@ private boolean recursiveExpand(TreeItem[] items, IProgressMonitor monitor, long * override. * * @param visible boolean - * @deprecated As of 4.13 not used anymore */ - @Deprecated(since = "2025-03", forRemoval = true) protected void updateToolbar(boolean visible) { // nothing to do }