Community
Participate
Working Groups
4.2-M20121107-1200 and master. The 'Build All' menu item is not correctly enabled and disabled. Test Case 1: 1. start a workspace where 'Build automatically' is selected ==> Project > Build All is correctly disabled 2. toggle 'Build automatically' BUG: Project > Build All still disabled NOTE: the command is enabled i.e. using Ctrl+B actually triggers a build and then also enables the menu 3. toggle 'Build automatically' BUG: Project > Build All still enabled 4. Project > Build All ==> !ENTRY org.eclipse.ui.workbench 4 0 2012-11-13 12:57:04.738 !MESSAGE Trying to execute the disabled command org.eclipse.ui.project.buildAll !STACK 0 org.eclipse.core.commands.NotEnabledException: Trying to execute the disabled command org.eclipse.ui.project.buildAll at org.eclipse.ui.internal.handlers.LegacyHandlerService.executeCommand(LegacyHandlerService.java:510) at org.eclipse.ui.internal.actions.CommandAction.runWithEvent(CommandAction.java:157) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4169) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1022) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:916) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:587) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:542) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584) at org.eclipse.equinox.launcher.Main.run(Main.java:1438) at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
I have hit this as well. I have Build Automatically turned off. The enablement state only seems to be calculated on startup. If on startup the workspace is empty or all projects are closed, the command never gets enabled. If I change org.eclipse.ui.internal.ide.handlers.BuildAllProjectsHandler.setEnabled(Object) to always do setBaseEnabled(true) then the menu is enabled on startup(not that I'm suggesting that as a fix, just to help illustrate where the problem lies).
Bug 396418 might be a duplicate of this one. And also bug 366560.
Created attachment 225996 [details] Possible Fix
I looked at the patch and it looks good, it's providing the setEnabled(*) API through our 4.x handler proxy. It uses the same pattern as the other 4.x handler proxy methods. I've released this for 4.2.2 to be picked up on any rebuild. http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?h=R4_2_maintenance&id=ab7784a16df43c285660504767da4b32b843a21a PW
Also fixed in 'master' with: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=e296fb93d084a83d141c8a5494bb6fb8da71cae2
Verified in 4.2-M20130124-1700