1 11 package org.eclipse.ui.internal.ide.dialogs; 12 13 import org.eclipse.core.resources.IProject; 14 import org.eclipse.jface.window.Window; 15 import org.eclipse.ui.IWorkbenchWindow; 16 import org.eclipse.ui.PlatformUI; 17 import org.eclipse.ui.internal.ide.dialogs.InstallCapabilityStep.IProjectProvider; 18 import org.eclipse.ui.wizards.newresource.BasicNewResourceWizard; 19 20 public abstract class MultiStepCapabilityWizard extends MultiStepWizard 21 implements IProjectProvider { 22 25 protected MultiStepCapabilityWizard() { 26 super(); 27 } 28 29 33 protected abstract String [] getPerspectiveChoices(); 34 35 38 public boolean performFinish() { 39 if (!super.performFinish()) 40 return false; 41 42 if (isConfigureStepMode()) { 45 IWorkbenchWindow window = PlatformUI.getWorkbench() 46 .getActiveWorkbenchWindow(); 47 String [] perspIds = getPerspectiveChoices(); 48 if (perspIds.length > 0) { 49 ProjectPerspectiveChoiceDialog dialog; 50 dialog = new ProjectPerspectiveChoiceDialog(window, perspIds); 51 dialog.open(); 52 if (dialog.getReturnCode() == Window.OK) 53 window = dialog.showChosenPerspective(); 54 } 55 56 IProject project = getProject(); 57 if (project != null) { 58 BasicNewResourceWizard.selectAndReveal(project, window); 59 } 60 } 61 62 return true; 63 } 64 } 65 | Popular Tags |