From d6c128e9fcf77e2b623081dd05c95ce44a771952 Mon Sep 17 00:00:00 2001 From: DaveCarpeneto Date: Tue, 25 Jun 2024 21:33:16 -0400 Subject: [PATCH] Refresh option only available for projects eclipse-platform#1904 Returns functionality whereby open projects _and_ non-project resources get the 'refresh' contextual menu (option was removed for non-project resources via the fix @ https://github.com/eclipse-platform/eclipse.platform/issues/876 ). --- .../resources/actions/ResourceMgmtActionProvider.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/actions/ResourceMgmtActionProvider.java b/bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/actions/ResourceMgmtActionProvider.java index f860ce34324..a8fcea10af4 100644 --- a/bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/actions/ResourceMgmtActionProvider.java +++ b/bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/actions/ResourceMgmtActionProvider.java @@ -145,8 +145,10 @@ public void fillContextMenu(IMenuManager menu) { buildAction.selectionChanged(selection); menu.appendToGroup(ICommonMenuConstants.GROUP_BUILD, buildAction); } - // To refresh, even if one project is open - if (hasOpenProjects) { + // Add the 'refresh' item if any selection is either (a) an open project, or (b) + // a non-project selection (so the 'refresh' item is not shown if all selections + // are closed projects) + if (hasOpenProjects || !isProjectSelection) { refreshAction.selectionChanged(selection); menu.appendToGroup(ICommonMenuConstants.GROUP_BUILD, refreshAction); }