Community
Participate
Working Groups
Now middle-click only close one project which the mouse is over.
@Gao Hao I can't get my eclipse to *close* project (but maybe my mouse does not over a real "middle" button?), just *open* by doubleclick
New Gerrit change created: https://git.eclipse.org/r/164956
In Project Explorer, projects can be closed via middle-click. See: https://www.eclipse.org/eclipse/news/4.13/platform.php#close-project-via-middle-click
In my dev env I get this NPE when mid-clicking on a project: !ENTRY org.eclipse.ui.navigator.resources 4 2 2020-06-30 22:54:17.906 !MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.ui.navigator.resources". !STACK 0 java.lang.NullPointerException at org.eclipse.ui.actions.CloseResourceAction.run(CloseResourceAction.java:202) at org.eclipse.ui.navigator.resources.ProjectExplorer$1.handleMiddleClick(ProjectExplorer.java:398) at org.eclipse.ui.navigator.resources.ProjectExplorer$1.lambda$0(ProjectExplorer.java:383) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) at org.eclipse.ui.navigator.resources.ProjectExplorer$1.mouseUp(ProjectExplorer.java:382) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:224) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4385) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1512) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1535) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1520) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1324) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3789) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1157) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155) at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:658) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:557) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:154) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:150) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:657) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594) at org.eclipse.equinox.launcher.Main.run(Main.java:1447) at org.eclipse.equinox.launcher.Main.main(Main.java:1420)
The CloseResourceAction is created with a IShellProvider that always provides null. This is causing the NPE. While I'm on it I think the middle-click could not just close one project, but all selected. And it could open the projects if all selected projects are closed. To be in synch, closing projects on multi-selection should only be done when all are closed. Or what would be the default when there are mixed opened and closed projects? Close/Open/Toggle? I'm providing a patch now that would perform the resource action only when all have the same state.
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/165636
NPE was introduced with the middle-click feature introduction via bug#549894
@Karsten Thoms thanks for taking care!