1 11 package org.eclipse.ui.wizards.datatransfer; 12 13 import org.eclipse.jface.dialogs.IDialogSettings; 14 import org.eclipse.jface.viewers.IStructuredSelection; 15 import org.eclipse.jface.wizard.Wizard; 16 import org.eclipse.ui.IImportWizard; 17 import org.eclipse.ui.IWorkbench; 18 import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin; 19 import org.eclipse.ui.internal.wizards.datatransfer.DataTransferMessages; 20 import org.eclipse.ui.internal.wizards.datatransfer.WizardProjectsImportPage; 21 22 42 43 public class ExternalProjectImportWizard extends Wizard implements 44 IImportWizard { 45 private static final String EXTERNAL_PROJECT_SECTION = "ExternalProjectImportWizard"; private WizardProjectsImportPage mainPage; 47 48 51 public ExternalProjectImportWizard() { 52 super(); 53 setNeedsProgressMonitor(true); 54 IDialogSettings workbenchSettings = IDEWorkbenchPlugin.getDefault() 55 .getDialogSettings(); 56 57 IDialogSettings wizardSettings = workbenchSettings 58 .getSection(EXTERNAL_PROJECT_SECTION); 59 if (wizardSettings == null) { 60 wizardSettings = workbenchSettings 61 .addNewSection(EXTERNAL_PROJECT_SECTION); 62 } 63 setDialogSettings(wizardSettings); 64 } 65 66 69 public void addPages() { 70 super.addPages(); 71 mainPage = new WizardProjectsImportPage(); 72 addPage(mainPage); 73 } 74 75 78 public void init(IWorkbench workbench, IStructuredSelection currentSelection) { 79 setWindowTitle(DataTransferMessages.DataTransfer_importTitle); 80 setDefaultPageImageDescriptor( 81 IDEWorkbenchPlugin.getIDEImageDescriptor("wizban/importproj_wiz.png")); 83 } 84 85 88 public boolean performCancel() { 89 mainPage.performCancel(); 90 return true; 91 } 92 93 96 public boolean performFinish() { 97 return mainPage.createProjects(); 98 } 99 100 } 101 | Popular Tags |