]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/sharedontology/wizard/ModelExportWizard.java
Remove usage of deprecated SimanticsUI-methods
[simantics/platform.git] / bundles / org.simantics.modeling.ui / src / org / simantics / modeling / ui / sharedontology / wizard / ModelExportWizard.java
index 37996107eb9d0829fe71cd654a182d86f28d506f..8a3bd6999f5a877bd8becfd29dae6f4a6d0b641a 100644 (file)
@@ -26,18 +26,18 @@ import org.eclipse.jface.wizard.WizardPage;
 import org.eclipse.ui.IExportWizard;
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.preferences.ScopedPreferenceStore;
+import org.simantics.Simantics;
 import org.simantics.db.management.ISessionContext;
 import org.simantics.modeling.ui.Activator;
 import org.simantics.modeling.ui.utils.NoProjectPage;
 import org.simantics.project.IProject;
 import org.simantics.project.ProjectKeys;
-import org.simantics.ui.SimanticsUI;
 import org.simantics.utils.ui.ErrorLogger;
 import org.simantics.utils.ui.ExceptionUtils;
 
 /**
  * @author Tuukka Lehtonen
- * @author Teemu Mätäsniemi
+ * @author Teemu Mätäsniemi
  * @author Antti Villberg
  */
 public class ModelExportWizard extends Wizard implements IExportWizard {
@@ -46,8 +46,9 @@ public class ModelExportWizard extends Wizard implements IExportWizard {
 
     Deque<String>            recentExportPaths;
     boolean                  overwrite;
+    boolean                  includeDependencies;
 
-    ExportPlan        exportModel;
+    ExportPlan               exportModel;
 
     private boolean readPreferences() {
         IPreferenceStore store = new ScopedPreferenceStore(InstanceScope.INSTANCE, Activator.PLUGIN_ID);
@@ -55,6 +56,7 @@ public class ModelExportWizard extends Wizard implements IExportWizard {
         String recentPathsPref = store.getString(Preferences.RECENT_SHARED_LIBRARY_EXPORT_LOCATIONS);
         recentExportPaths = Preferences.decodePaths(recentPathsPref);
         overwrite = store.getBoolean(Preferences.SHARED_LIBRARY_EXPORT_OVERWRITE);
+        includeDependencies = store.getBoolean(Preferences.EXPORT_INCLUDE_DEPENDENCIES);
 
         return true;
     }
@@ -64,6 +66,7 @@ public class ModelExportWizard extends Wizard implements IExportWizard {
 
         store.putValue(Preferences.RECENT_SHARED_LIBRARY_EXPORT_LOCATIONS, Preferences.encodePaths(recentExportPaths));
         store.setValue(Preferences.SHARED_LIBRARY_EXPORT_OVERWRITE, exportModel.overwrite);
+        store.setValue(Preferences.EXPORT_INCLUDE_DEPENDENCIES, exportModel.includeDependencies);
 
         if (store.needsSaving())
             store.save();
@@ -78,7 +81,7 @@ public class ModelExportWizard extends Wizard implements IExportWizard {
     public void init(IWorkbench workbench, IStructuredSelection selection) {
         readPreferences();
 
-        ISessionContext ctx = SimanticsUI.getSessionContext();
+        ISessionContext ctx = Simantics.getSessionContext();
         if (ctx == null)
             return;
         IProject project = ctx.getHint(ProjectKeys.KEY_PROJECT);
@@ -89,6 +92,7 @@ public class ModelExportWizard extends Wizard implements IExportWizard {
         exportModel.project = project;
         exportModel.selection = selection;
         exportModel.overwrite = overwrite;
+        exportModel.includeDependencies = includeDependencies;
     }
 
     @Override