1 11 package org.eclipse.ui.internal.wizards.preferences; 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.IWorkbenchGraphicConstants; 19 import org.eclipse.ui.internal.WorkbenchImages; 20 import org.eclipse.ui.internal.WorkbenchPlugin; 21 22 23 47 public class PreferencesImportWizard extends Wizard implements IImportWizard { 48 49 private WizardPreferencesImportPage1 mainPage; 50 51 55 public PreferencesImportWizard() { 56 IDialogSettings workbenchSettings = WorkbenchPlugin.getDefault().getDialogSettings(); 57 IDialogSettings section = workbenchSettings 58 .getSection("PreferencesImportWizard"); if (section == null) { 60 section = workbenchSettings.addNewSection("PreferencesImportWizard"); } 62 setDialogSettings(section); 63 } 64 65 68 public void addPages() { 69 super.addPages(); 70 mainPage = new WizardPreferencesImportPage1(); 71 addPage(mainPage); 72 } 73 74 77 public void init(IWorkbench workbench, IStructuredSelection currentSelection) { 78 setWindowTitle(PreferencesMessages.PreferencesImportWizard_import); 79 setDefaultPageImageDescriptor(WorkbenchImages 80 .getImageDescriptor(IWorkbenchGraphicConstants.IMG_WIZBAN_IMPORT_PREF_WIZ)); 81 setNeedsProgressMonitor(true); 82 } 83 84 87 public boolean performFinish() { 88 return mainPage.finish(); 89 } 90 } 91 | Popular Tags |