1 package org.simantics.sysdyn.ui.wizards.functions;
\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 ImportWizardFunction extends Wizard implements IImportWizard {
\r
14 private WizardFunctionsImportPage mainPage;
\r
15 private IStructuredSelection currentSelection = null;
\r
16 private String initialPath = null;
\r
17 public Resource selection;
\r
20 * Constructor for ImportWizardFunction.
\r
22 public ImportWizardFunction() {
\r
27 * Constructor for ImportWizardFunction.
\r
29 public ImportWizardFunction(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 WizardFunctionsImportPage(
\r
44 "wizardFunctionsImportPage", initialPath, currentSelection); //$NON-NLS-1$
\r
49 public boolean performFinish() {
\r
50 return mainPage.createProjects();
\r