1 11 package org.eclipse.pde.internal.ui.wizards.extension; 12 13 import org.eclipse.core.resources.IProject; 14 import org.eclipse.jface.viewers.IStructuredSelection; 15 import org.eclipse.jface.wizard.Wizard; 16 import org.eclipse.pde.core.plugin.IPluginModelBase; 17 import org.eclipse.pde.internal.ui.PDEPlugin; 18 import org.eclipse.pde.internal.ui.PDEPluginImages; 19 import org.eclipse.pde.internal.ui.PDEUIMessages; 20 import org.eclipse.pde.internal.ui.elements.ElementList; 21 22 public class ExtensionEditorWizard extends Wizard { 23 public static final String PLUGIN_POINT = "newExtension"; private ExtensionEditorSelectionPage pointPage; 25 private IPluginModelBase model; 26 private IProject project; 27 private IStructuredSelection selection; 28 private ElementList wizards; 29 30 public ExtensionEditorWizard(IProject project, IPluginModelBase model, IStructuredSelection selection) { 31 setDialogSettings(PDEPlugin.getDefault().getDialogSettings()); 32 setDefaultPageImageDescriptor(PDEPluginImages.DESC_NEWEX_WIZ); 33 this.model = model; 34 this.project = project; 35 this.selection = selection; 36 setForcePreviousAndNextButtons(true); 37 setWindowTitle(PDEUIMessages.ExtensionEditorWizard_wtitle); 38 PDEPlugin.getDefault().getLabelProvider().connect(this); 39 loadWizardCollection(); 40 } 41 public void addPages() { 42 pointPage = 43 new ExtensionEditorSelectionPage(wizards); 44 pointPage.init(project, model.getPluginBase(), selection); 45 addPage(pointPage); 46 } 47 private void loadWizardCollection() { 48 NewExtensionRegistryReader reader = new NewExtensionRegistryReader(true); 49 wizards = reader.readRegistry( 50 PDEPlugin.getPluginId(), 51 PLUGIN_POINT, 52 true); 53 } 54 55 public boolean performFinish() { 56 return true; 57 } 58 59 public void dispose() { 60 super.dispose(); 61 PDEPlugin.getDefault().getLabelProvider().disconnect(this); 62 } 63 } 64 | Popular Tags |