- @Override
- public void run(ReadGraph graph) throws DatabaseException {
- TransferableGraphConfiguration2 conf = new TransferableGraphConfiguration2(graph, info.library.getResource(), true, false);
- if(includeDependencies) {
- ModelDependenciesBean bean = ModelDependenciesBean.create(graph, info.library.getResource());
- conf.baseExtensions.put(ModelDependenciesBean.EXTENSION_KEY, new Variant(ModelDependenciesBean.BINDING, bean));
- }
- ModelingUtils.exportModel(graph, conf, location.getAbsolutePath(), "", 1);
- }
-
- });
+ public static void doExport(IProgressMonitor monitor, final File location, final LibraryInfo info, boolean includeDependencies) throws DatabaseException, IOException {
+ Simantics.sync(new ReadRequest() {
+ @Override
+ public void run(ReadGraph graph) throws DatabaseException {
+ TransferableGraphConfiguration2 conf = new TransferableGraphConfiguration2(graph, info.library.getResource(), true, false);
+ if (includeDependencies) {
+ ModelDependenciesBean bean = ModelDependenciesBean.create(graph, info.library.getResource());
+ conf.baseExtensions.put(ModelDependenciesBean.EXTENSION_KEY, new Variant(ModelDependenciesBean.BINDING, bean));
+ }
+ ModelingUtils.exportModel(graph, conf, location.getAbsolutePath(), "", 1);
+ }
+ });