1 11 package org.eclipse.pde.internal.ui.wizards.extension; 12 13 import org.eclipse.core.resources.IProject; 14 import org.eclipse.core.runtime.CoreException; 15 import org.eclipse.jface.viewers.IStructuredSelection; 16 import org.eclipse.jface.wizard.IWizardNode; 17 import org.eclipse.pde.core.plugin.IPluginBase; 18 import org.eclipse.pde.internal.ui.PDEUIMessages; 19 import org.eclipse.pde.internal.ui.elements.ElementList; 20 import org.eclipse.pde.internal.ui.wizards.WizardElement; 21 import org.eclipse.pde.internal.ui.wizards.WizardListSelectionPage; 22 import org.eclipse.pde.internal.ui.wizards.WizardNode; 23 import org.eclipse.pde.ui.IBasePluginWizard; 24 import org.eclipse.pde.ui.IExtensionEditorWizard; 25 26 29 public class ExtensionEditorSelectionPage extends WizardListSelectionPage { 30 private IProject fProject; 31 private IPluginBase fPluginBase; 32 private IStructuredSelection fSelection; 33 38 public ExtensionEditorSelectionPage(ElementList wizards) { 39 super(wizards, PDEUIMessages.ExtensionEditorSelectionPage_message); 40 setTitle(PDEUIMessages.ExtensionEditorSelectionPage_title); 41 setDescription(PDEUIMessages.ExtensionEditorSelectionPage_desc); 42 } 43 public void init(IProject project, IPluginBase pluginBase, IStructuredSelection selection) { 44 this.fProject = project; 45 this.fPluginBase = pluginBase; 46 this.fSelection = selection; 47 } 48 protected IWizardNode createWizardNode(WizardElement element) { 49 return new WizardNode(this, element) { 50 public IBasePluginWizard createWizard() throws CoreException { 51 IExtensionEditorWizard wizard = createWizard(wizardElement); 52 wizard.init(fProject, fPluginBase.getPluginModel(), fSelection); 53 return wizard; 54 } 55 protected IExtensionEditorWizard createWizard(WizardElement element) 56 throws CoreException { 57 return (IExtensionEditorWizard) element.createExecutableExtension(); 58 } 59 }; 60 } 61 } 62 | Popular Tags |