Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 95100
Collapse All | Expand All

(-)Eclipse UI/org/eclipse/ui/internal/dialogs/NewWizardNewPage.java (-17 / +7 lines)
Lines 65-72 Link Here
65
 * New wizard selection tab that allows the user to select a registered 'New'
65
 * New wizard selection tab that allows the user to select a registered 'New'
66
 * wizard to be launched.
66
 * wizard to be launched.
67
 */
67
 */
68
class NewWizardNewPage implements ISelectionChangedListener,
68
class NewWizardNewPage implements ISelectionChangedListener {
69
        IDoubleClickListener {
70
69
71
    // id constants
70
    // id constants
72
    private static final String DIALOG_SETTING_SECTION_NAME = "NewWizardSelectionPage."; //$NON-NLS-1$
71
    private static final String DIALOG_SETTING_SECTION_NAME = "NewWizardSelectionPage."; //$NON-NLS-1$
Lines 323-329 Link Here
323
        viewer.setLabelProvider(new WorkbenchLabelProvider());
322
        viewer.setLabelProvider(new WorkbenchLabelProvider());
324
        viewer.setSorter(NewWizardCollectionSorter.INSTANCE);
323
        viewer.setSorter(NewWizardCollectionSorter.INSTANCE);
325
        viewer.addSelectionChangedListener(this);
324
        viewer.addSelectionChangedListener(this);
326
        viewer.addDoubleClickListener(this);
327
325
328
        ArrayList inputArray = new ArrayList();
326
        ArrayList inputArray = new ArrayList();
329
327
Lines 362-375 Link Here
362
             * @see org.eclipse.jface.viewers.IDoubleClickListener#doubleClick(org.eclipse.jface.viewers.DoubleClickEvent)
360
             * @see org.eclipse.jface.viewers.IDoubleClickListener#doubleClick(org.eclipse.jface.viewers.DoubleClickEvent)
363
             */
361
             */
364
            public void doubleClick(DoubleClickEvent event) {
362
            public void doubleClick(DoubleClickEvent event) {
365
                IStructuredSelection s = (IStructuredSelection) event
363
            	    IStructuredSelection s = (IStructuredSelection) event
366
                        .getSelection();
364
						.getSelection();
367
                Object element = s.getFirstElement();
365
				selectionChanged(new SelectionChangedEvent(event.getViewer(), s));
366
				
367
				Object element = s.getFirstElement();
368
                if (viewer.isExpandable(element)) {
368
                if (viewer.isExpandable(element)) {
369
                    viewer.setExpandedState(element, !viewer
369
                    viewer.setExpandedState(element, !viewer
370
                            .getExpandedState(element));
370
                            .getExpandedState(element));
371
                } else if (element instanceof WorkbenchWizardElement) {
371
                } else if (element instanceof WorkbenchWizardElement) {
372
                    page.advanceToNextPage();
372
                    page.advanceToNextPageOrFinish();
373
                }
373
                }
374
            }
374
            }
375
        });
375
        });
Lines 480-495 Link Here
480
    }
480
    }
481
481
482
    /**
482
    /**
483
     * A wizard in the wizard viewer has been double clicked. Treat it as a
484
     * selection.
485
     */
486
    public void doubleClick(DoubleClickEvent event) {
487
        selectionChanged(new SelectionChangedEvent(event.getViewer(), event
488
                .getViewer().getSelection()));
489
        page.advanceToNextPage();
490
    }
491
492
    /**
493
     * Expands the wizard categories in this page's category viewer that were
483
     * Expands the wizard categories in this page's category viewer that were
494
     * expanded last time this page was used. If a category that was previously
484
     * expanded last time this page was used. If a category that was previously
495
     * expanded no longer exists then it is ignored.
485
     * expanded no longer exists then it is ignored.
(-)Eclipse UI/org/eclipse/ui/internal/dialogs/NewWizardSelectionPage.java (-2 / +8 lines)
Lines 12-17 Link Here
12
12
13
import org.eclipse.jface.dialogs.IDialogSettings;
13
import org.eclipse.jface.dialogs.IDialogSettings;
14
import org.eclipse.jface.viewers.IStructuredSelection;
14
import org.eclipse.jface.viewers.IStructuredSelection;
15
import org.eclipse.jface.wizard.WizardDialog;
15
import org.eclipse.swt.widgets.Composite;
16
import org.eclipse.swt.widgets.Composite;
16
import org.eclipse.swt.widgets.Control;
17
import org.eclipse.swt.widgets.Control;
17
import org.eclipse.ui.IWorkbench;
18
import org.eclipse.ui.IWorkbench;
Lines 65-72 Link Here
65
    /**
66
    /**
66
     * Makes the next page visible.
67
     * Makes the next page visible.
67
     */
68
     */
68
    public void advanceToNextPage() {
69
    public void advanceToNextPageOrFinish() {
69
        getContainer().showPage(getNextPage());
70
    		if (canFlipToNextPage())
71
    			getContainer().showPage(getNextPage());
72
    		else if (canFinishEarly()) {
73
    			if (getWizard().performFinish()) //the following is bad - we need methods on IWizardContainer to accomplish this
74
    				((WizardDialog)getContainer()).close();
75
    		}
70
    }
76
    }
71
77
72
    /** (non-Javadoc)
78
    /** (non-Javadoc)

Return to bug 95100