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.internal.ui.JavaPlugin; 19 import org.eclipse.jdt.internal.ui.JavaPluginImages; 20 21 22 public class NewSourceFolderCreationWizard extends NewElementWizard { 23 24 private NewSourceFolderWizardPage fPage; 25 26 public NewSourceFolderCreationWizard() { 27 super(); 28 setDefaultPageImageDescriptor(JavaPluginImages.DESC_WIZBAN_NEWSRCFOLDR); 29 setDialogSettings(JavaPlugin.getDefault().getDialogSettings()); 30 setWindowTitle(NewWizardMessages.NewSourceFolderCreationWizard_title); 31 } 32 33 36 public void addPages() { 37 super.addPages(); 38 fPage= new NewSourceFolderWizardPage(); 39 addPage(fPage); 40 fPage.init(getSelection()); 41 } 42 43 46 protected void finishPage(IProgressMonitor monitor) throws InterruptedException , CoreException { 47 fPage.createPackageFragmentRoot(monitor); } 49 50 53 public boolean performFinish() { 54 boolean res= super.performFinish(); 55 if (res) { 56 selectAndReveal(fPage.getCorrespondingResource()); 57 } 58 return res; 59 } 60 61 64 public IJavaElement getCreatedElement() { 65 return fPage.getNewPackageFragmentRoot(); 66 } 67 68 } 69 | Popular Tags |