Bug 77871 [GlobalActions] (Re)Build Project should track resources itself
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/actions/BuildCleanAction.java
}
    /* (non-Javadoc)
     * @see org.eclipse.ui.actions.ActionFactory.IWorkbenchAction#dispose()
     */
    public void dispose() {
        
    }
    public void run() {
        ISelection selection = window.getSelectionService().getSelection();
        IProject[] selected = null;
        if (selection != null && !selection.isEmpty()
                && selection instanceof IStructuredSelection) {
            selected = BuildSetAction
                    .extractProjects(((IStructuredSelection) selection)
                            .toArray());
        } else {
            
            IWorkbenchPart part = window.getPartService().getActivePart();
            if (part instanceof IEditorPart) {
                IEditorInput input = ((IEditorPart) part).getEditorInput();
                if (input instanceof IFileEditorInput)
                    selected = new IProject[] { ((IFileEditorInput) input)
                            .getFile().getProject() };
            }
        }
        if (selected == null)
            selected = new IProject[0];
        new CleanDialog(window, selected).open();
    }
}