1 11 package org.eclipse.ui.internal.ide.dialogs; 12 13 import org.eclipse.core.resources.IProject; 14 import org.eclipse.jface.viewers.StructuredSelection; 15 import org.eclipse.jface.wizard.IWizard; 16 import org.eclipse.osgi.util.NLS; 17 import org.eclipse.ui.ICapabilityInstallWizard; 18 import org.eclipse.ui.IWorkbench; 19 import org.eclipse.ui.internal.ide.IDEWorkbenchMessages; 20 import org.eclipse.ui.internal.ide.registry.Capability; 21 22 26 public class InstallCapabilityStep extends WizardStep { 27 private Capability capability; 28 29 private ICapabilityInstallWizard wizard; 30 31 private IWorkbench workbench; 32 33 private IProjectProvider projectProvider; 34 35 41 public InstallCapabilityStep(int number, Capability capability, 42 IWorkbench workbench, IProjectProvider projectProvider) { 43 super(number); 44 this.capability = capability; 45 this.workbench = workbench; 46 this.projectProvider = projectProvider; 47 } 48 49 52 public String getLabel() { 53 return NLS.bind(IDEWorkbenchMessages.InstallCapabilityStep_label, capability.getName()); 54 } 55 56 59 public String getDetails() { 60 return capability.getInstallDetails(); 61 } 62 63 66 public IWizard getWizard() { 67 if (wizard == null) { 68 wizard = capability.getInstallWizard(); 69 if (wizard != null) { 70 wizard.init(workbench, StructuredSelection.EMPTY, 71 projectProvider.getProject()); 72 wizard.addPages(); 73 } 74 } 75 76 return wizard; 77 } 78 79 interface IProjectProvider { 80 84 public IProject getProject(); 85 } 86 } 87 | Popular Tags |