1 package org.simantics.sysdyn.ui.wizards.modules;
\r
4 import org.eclipse.jface.viewers.IStructuredSelection;
\r
5 import org.eclipse.jface.wizard.Wizard;
\r
6 import org.eclipse.ui.IImportWizard;
\r
7 import org.eclipse.ui.IWorkbench;
\r
8 import org.simantics.db.Resource;
\r
9 import org.simantics.ui.utils.AdaptionUtils;
\r
12 public class ImportWizardModule extends Wizard implements IImportWizard {
\r
14 private WizardModulesImportPage mainPage;
\r
15 private IStructuredSelection currentSelection = null;
\r
16 private String initialPath = null;
\r
17 public Resource selection;
\r
20 * Constructor for ExternalProjectImportWizard.
\r
22 public ImportWizardModule() {
\r
27 * Constructor for ExternalProjectImportWizard.
\r
29 public ImportWizardModule(String initialPath)
\r
32 this.initialPath = initialPath;
\r
35 public void init(IWorkbench workbench, IStructuredSelection currentSelection) {
\r
36 setWindowTitle("Import");
\r
37 this.currentSelection = currentSelection;
\r
38 selection = (Resource)AdaptionUtils.adaptToSingle(currentSelection, org.simantics.db.Resource.class);
\r
41 public void addPages() {
\r
43 mainPage = new WizardModulesImportPage(
\r
44 "wizardModulesImportPage", initialPath, currentSelection); //$NON-NLS-1$
\r
49 public boolean performFinish() {
\r
50 return mainPage.createProjects();
\r