1 11 package org.eclipse.pde.internal.ui.wizards.feature; 12 13 import org.eclipse.debug.core.ILaunchConfiguration; 14 import org.eclipse.jface.operation.IRunnableWithProgress; 15 import org.eclipse.pde.core.plugin.PluginRegistry; 16 import org.eclipse.pde.internal.ui.PDEPluginImages; 17 import org.eclipse.pde.internal.ui.PDEUIMessages; 18 19 public class NewFeatureProjectWizard extends AbstractNewFeatureWizard { 20 21 private String fId; 22 private String fVersion; 23 24 public NewFeatureProjectWizard() { 25 super(); 26 setDefaultPageImageDescriptor(PDEPluginImages.DESC_NEWFTRPRJ_WIZ); 27 setWindowTitle(PDEUIMessages.NewFeatureWizard_wtitle); 28 } 29 30 public void addPages() { 31 super.addPages(); 32 if (hasInterestingProjects()) { 33 fSecondPage = new PluginListPage(); 34 addPage(fSecondPage); 35 } 36 } 37 38 private boolean hasInterestingProjects() { 39 return PluginRegistry.getActiveModels().length > 0; 40 } 41 42 protected AbstractFeatureSpecPage createFirstPage() { 43 return new FeatureSpecPage(); 44 } 45 46 public String getFeatureId() { 47 return fId; 48 } 49 50 public String getFeatureVersion() { 51 return fVersion; 52 } 53 54 protected IRunnableWithProgress getOperation() { 55 FeatureData data = fProvider.getFeatureData(); 56 fId = data.id; 57 fVersion = data.version; 58 ILaunchConfiguration config= fProvider.getLaunchConfiguration(); 59 if (config == null) 60 return new CreateFeatureProjectOperation( 61 fProvider.getProject(), 62 fProvider.getLocationPath(), 63 data, 64 fProvider.getPluginListSelection(), 65 getShell()); 66 return new CreateFeatureProjectFromLaunchOperation( 67 fProvider.getProject(), 68 fProvider.getLocationPath(), 69 data, 70 config, 71 getShell()); 72 } 73 74 } 75 | Popular Tags |