Bug 57321 Remaining build UI items
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/dialogs/CleanDialog.java
* @param window the window to create it in
     * @param selection the currently selected projects (may be empty)
     */
    public CleanDialog(IWorkbenchWindow window, IProject[] selection) {
        super(
                window.getShell(),
                IDEWorkbenchMessages.getString("CleanDialog.title"), null, getQuestion(), QUESTION, new String[] { 
                IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL }, 0);
        this.window = window;
        this.selection = selection;
        if (this.selection == null)
            this.selection = new Object[0];
    }
    protected void browsePressed() {
        ILabelProvider labelProvider = new WorkbenchLabelProvider();
        ElementListSelectionDialog dialog = new ElementListSelectionDialog(
                getShell(), labelProvider);
        dialog.setMultipleSelection(true);
        dialog.setTitle("Project Selection"); 
        dialog.setMessage("Chose projects to clean:"); 
        dialog.setElements(ResourcesPlugin.getWorkspace().getRoot()
                .getProjects());
        dialog.setInitialSelections(new Object[] { selection });
        if (dialog.open() == Window.OK) {
            selection = dialog.getResult();
            if (selection == null)
                selection = new Object[0];
        }
        setProjectName();
        updateEnablement();