Skip to content

Commit 2281d4f

Browse files
Update ResourceMgmtActionProvider.java
Fixes #2538
1 parent 7aaa014 commit 2281d4f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

bundles/org.eclipse.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/actions/ResourceMgmtActionProvider.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,11 @@ public void fillContextMenu(IMenuManager menu) {
119119
boolean hasClosedProjects = false;
120120
boolean hasBuilder = true; // false if any project is closed or does not
121121
// have builder
122-
123-
Iterator<IProject> projects = selectionToProjects(selection).iterator();
124-
125-
while (projects.hasNext() && (!hasOpenProjects || !hasClosedProjects || hasBuilder || isProjectSelection)) {
126-
IProject project = projects.next();
122+
List<IProject> projects = selectionToProjects(selection);
123+
Iterator<IProject> projectIter = projects.iterator();
124+
125+
while (projectIter.hasNext() && (!hasOpenProjects || !hasClosedProjects || hasBuilder || isProjectSelection)) {
126+
IProject project = projectIter.next();
127127

128128
if (project == null) {
129129
isProjectSelection = false;
@@ -148,7 +148,7 @@ public void fillContextMenu(IMenuManager menu) {
148148
// Add the 'refresh' item if any selection is either (a) an open project, or (b)
149149
// a non-project selection (so the 'refresh' item is not shown if all selections
150150
// are closed projects)
151-
if (hasOpenProjects || !isProjectSelection) {
151+
if (hasOpenProjects || projects.size() < selection.size()) {
152152
refreshAction.selectionChanged(selection);
153153
menu.appendToGroup(ICommonMenuConstants.GROUP_BUILD, refreshAction);
154154
}

0 commit comments

Comments
 (0)