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 {
Deque<String> recentExportPaths;
boolean overwrite;
+ boolean includeDependencies;
- ExportPlan exportModel;
+ ExportPlan exportModel;
private boolean readPreferences() {
IPreferenceStore store = new ScopedPreferenceStore(InstanceScope.INSTANCE, Activator.PLUGIN_ID);
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;
}
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();
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);
exportModel.project = project;
exportModel.selection = selection;
exportModel.overwrite = overwrite;
+ exportModel.includeDependencies = includeDependencies;
}
@Override