Bug 77871 [GlobalActions] (Re)Build Project should track resources itself
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/actions/BuildSetAction.java
lastBuilt = this;
        
        setActionDefinitionId("org.eclipse.ui.project.buildLast"); 
        actionBars.registerGlobalAction(this);
        window.getWorkbench().getWorkingSetManager().addRecentWorkingSet(
                workingSet);
        IProject[] projects = extractProjects(workingSet.getElements());
        if (projects.length == 0)
            return;
        BuildAction build = new BuildAction(window.getShell(),
                IncrementalProjectBuilder.INCREMENTAL_BUILD);
        build.selectionChanged(new StructuredSelection(projects));
        build.run();
    }
    public void runWithEvent(Event event) {
        
        
        if (event.widget instanceof MenuItem) {
            if (!((MenuItem) event.widget).getSelection())
                return;
        }
        run();
    }
    /* (non-Javadoc)
     * For debugging purposes only.
     */
    public String toString() {
        return "BuildSetAction(" + workingSet.getName() + ")"; 
    }
}