Skip to content

Commit f2e2f88

Browse files
committed
Revert "Defer expensive project reference computation during selection changes"
This reverts commit 3aaea37e05f6d0e2ff90db5b2030dca8b1a98c83 and the follow-up Javadoc fix in 3b23ac5. The override of updateSelection() introduced in #3871 left CloseUnrelatedProjectsAction enabled after the last unrelated project was closed, because the cheap enablement check no longer consulted the project graph. Restoring the previous behavior is the simplest fix while a follow-up addresses the original UI-thread cost separately. Refs #2636
1 parent e86d7f2 commit f2e2f88

1 file changed

Lines changed: 0 additions & 20 deletions

File tree

bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/actions/CloseUnrelatedProjectsAction.java

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import org.eclipse.jface.dialogs.IDialogConstants;
3131
import org.eclipse.jface.dialogs.MessageDialogWithToggle;
3232
import org.eclipse.jface.preference.IPreferenceStore;
33-
import org.eclipse.jface.viewers.IStructuredSelection;
3433
import org.eclipse.jface.window.IShellProvider;
3534
import org.eclipse.osgi.util.NLS;
3635
import org.eclipse.swt.widgets.Shell;
@@ -131,25 +130,6 @@ public CloseUnrelatedProjectsAction(IShellProvider provider){
131130
initAction();
132131
}
133132

134-
/**
135-
* Overrides to avoid calling the expensive
136-
* {@code computeRelated(List)} during selection changes. Uses only
137-
* the raw selection to determine enablement.
138-
*/
139-
@Override
140-
protected boolean updateSelection(IStructuredSelection s) {
141-
selectionDirty = true;
142-
if (!selectionIsOfType(IResource.PROJECT)) {
143-
return false;
144-
}
145-
for (IResource resource : super.getSelectedResources()) {
146-
if (resource instanceof IProject project && project.isOpen()) {
147-
return true;
148-
}
149-
}
150-
return false;
151-
}
152-
153133
@Override
154134
public void run() {
155135
if (promptForConfirmation()) {

0 commit comments

Comments
 (0)