]> gerrit.simantics Code Review - simantics/sysdyn.git/blob
e743d75055341aa373a72d52a990a2a4cfca8dcb
[simantics/sysdyn.git] /
1 package org.simantics.sysdyn.ui.wizards.models;\r
2 \r
3 import org.eclipse.jface.viewers.IStructuredSelection;\r
4 import org.eclipse.jface.wizard.Wizard;\r
5 import org.eclipse.ui.IImportWizard;\r
6 import org.eclipse.ui.IWorkbench;\r
7 \r
8 \r
9 public class ImportWizardModel extends Wizard implements IImportWizard {\r
10         \r
11         private WizardModelsImportPage mainPage;\r
12         private IStructuredSelection currentSelection = null;\r
13         private String initialPath = null;\r
14         \r
15     /**\r
16      * Constructor for ExternalProjectImportWizard.\r
17      */\r
18     public ImportWizardModel() {\r
19         this(null);\r
20     }\r
21     \r
22     /**\r
23      * Constructor for ExternalProjectImportWizard.\r
24      */\r
25     public ImportWizardModel(String initialPath)\r
26     {\r
27         super();\r
28         this.initialPath = initialPath;      \r
29     }\r
30 \r
31     public void addPages() {\r
32         super.addPages();\r
33                 mainPage = new WizardModelsImportPage(\r
34                                 "wizardModelsImportPage", initialPath, currentSelection); //$NON-NLS-1$\r
35         addPage(mainPage);\r
36     }\r
37     \r
38     public void init(IWorkbench workbench, IStructuredSelection currentSelection) {\r
39         setWindowTitle("Import");\r
40         this.currentSelection = currentSelection;\r
41     }\r
42 \r
43         @Override\r
44         public boolean performFinish() {\r
45                 return mainPage.createProjects();\r
46         }\r
47 \r
48 }