]> gerrit.simantics Code Review - simantics/sysdyn.git/blob
c35344036a30e1ed96704df98f2b97f597c911d1
[simantics/sysdyn.git] /
1 package org.simantics.sysdyn.ui.wizards.modules;\r
2 \r
3 \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
10 \r
11 \r
12 public class ExportWizardModule extends Wizard implements IImportWizard {\r
13         \r
14         private WizardModulesExportPage mainPage;\r
15         private IStructuredSelection currentSelection = null;\r
16         private String initialPath = null;\r
17         public Resource selection;\r
18 \r
19     /**\r
20      * Constructor for ExternalProjectImportWizard.\r
21      */\r
22     public ExportWizardModule() {\r
23         this(null);\r
24     }\r
25     \r
26     /**\r
27      * Constructor for ExternalProjectImportWizard.\r
28      */\r
29     public ExportWizardModule(String initialPath)\r
30     {\r
31         super();\r
32         this.initialPath = initialPath;\r
33     }\r
34  \r
35     public void init(IWorkbench workbench, IStructuredSelection currentSelection) {\r
36         setWindowTitle("Export");\r
37         this.currentSelection = currentSelection;\r
38         selection = (Resource)AdaptionUtils.adaptToSingle(currentSelection, org.simantics.db.Resource.class);\r
39     }\r
40     \r
41     public void addPages() {\r
42         super.addPages();\r
43                 mainPage = new WizardModulesExportPage(\r
44                                 "wizardModulesExportPage", initialPath, currentSelection); //$NON-NLS-1$\r
45         addPage(mainPage);\r
46     }\r
47 \r
48         @Override\r
49         public boolean performFinish() {\r
50                 return mainPage.createProjects();\r
51                 \r
52         }\r
53 \r
54 }