1 11 package org.eclipse.ui.wizards.newresource; 12 13 import org.eclipse.core.resources.IFolder; 14 import org.eclipse.jface.resource.ImageDescriptor; 15 import org.eclipse.jface.viewers.IStructuredSelection; 16 import org.eclipse.ui.IWorkbench; 17 import org.eclipse.ui.dialogs.WizardNewFolderMainPage; 18 import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin; 19 import org.eclipse.ui.internal.wizards.newresource.ResourceMessages; 20 21 41 public class BasicNewFolderResourceWizard extends BasicNewResourceWizard { 42 private WizardNewFolderMainPage mainPage; 43 44 47 public BasicNewFolderResourceWizard() { 48 super(); 49 } 50 51 54 public void addPages() { 55 super.addPages(); 56 mainPage = new WizardNewFolderMainPage(ResourceMessages.NewFolder_text, getSelection()); 57 addPage(mainPage); 58 } 59 60 63 public void init(IWorkbench workbench, IStructuredSelection currentSelection) { 64 super.init(workbench, currentSelection); 65 setWindowTitle(ResourceMessages.NewFolder_title); 66 setNeedsProgressMonitor(true); 67 } 68 69 72 protected void initializeDefaultPageImageDescriptor() { 73 ImageDescriptor desc = IDEWorkbenchPlugin.getIDEImageDescriptor("wizban/newfolder_wiz.png"); setDefaultPageImageDescriptor(desc); 75 76 } 77 78 81 public boolean performFinish() { 82 IFolder folder = mainPage.createNewFolder(); 83 if (folder == null) { 84 return false; 85 } 86 87 selectAndReveal(folder); 88 89 return true; 90 } 91 } 92 | Popular Tags |