1 11 package org.eclipse.jdt.internal.ui.wizards; 12 13 import org.eclipse.core.runtime.CoreException; 14 import org.eclipse.core.runtime.IProgressMonitor; 15 16 import org.eclipse.jdt.core.IJavaElement; 17 18 import org.eclipse.jdt.ui.wizards.NewPackageWizardPage; 19 20 import org.eclipse.jdt.internal.ui.JavaPlugin; 21 import org.eclipse.jdt.internal.ui.JavaPluginImages; 22 23 public class NewPackageCreationWizard extends NewElementWizard { 24 25 private NewPackageWizardPage fPage; 26 27 public NewPackageCreationWizard() { 28 super(); 29 setDefaultPageImageDescriptor(JavaPluginImages.DESC_WIZBAN_NEWPACK); 30 setDialogSettings(JavaPlugin.getDefault().getDialogSettings()); 31 setWindowTitle(NewWizardMessages.NewPackageCreationWizard_title); 32 } 33 34 37 public void addPages() { 38 super.addPages(); 39 fPage= new NewPackageWizardPage(); 40 addPage(fPage); 41 fPage.init(getSelection()); 42 } 43 44 47 protected void finishPage(IProgressMonitor monitor) throws InterruptedException , CoreException { 48 fPage.createPackage(monitor); } 50 51 54 public boolean performFinish() { 55 boolean res= super.performFinish(); 56 if (res) { 57 selectAndReveal(fPage.getModifiedResource()); 58 } 59 return res; 60 } 61 62 65 public IJavaElement getCreatedElement() { 66 return fPage.getNewPackageFragment(); 67 } 68 69 } 70 | Popular Tags |