Project: Eclipse_Platform_UI
Bug 201650 [Actions] Build Project is disabled when going from problems view to an editor
Reported: 2007-08-29 16:31:46 | Status: verified fixed

Build ID: I20070625-1500 Steps To Reproduce: 1. Turn off build automatically 2. Build a project with errors or warnings 3. Double click on a problem marker 4. Notice that Build Project is disabled. 5. You can click back and forth between the problems view and the editor and it's still disabled. More information: You have to click on the navigator view or similar to get the action enabled again. The problem is that the selection is calculated incorrectly. When you click on the editor after being on the problems view, the selection is a marker. When you click back on a marker in the problems view, the selection is a text selection. Set a breakpoint in org.eclipse.ui.internal.ide.actions.BuildUtilities.findSelectedProjects(IWorkbenchWindow) to see what I mean. It would appear that the wrong window is being found - see org.eclipse.ui.actions.BuildAction.isEnabled() for how the active window is determined. It certainly doesn't seem right. You could fix this particular issue without changing that logic by having Marker adapter to IResource, but that doesn't seem like the correct approach. I set the severity as major since this is such a common development task - going between the problems view and the editor containing the errors, and building.

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WWinPartService.java