/**
* @author Tuukka Lehtonen
- * @author Teemu Mätäsniemi
+ * @author Teemu M�t�sniemi
*/
public class AnnotationTypeExporter implements IRunnableWithProgress {
public SimanticsClipboard perform(ReadGraph graph) throws DatabaseException {
CopyHandler ch = graph.adapt(annotation, CopyHandler.class);
SimanticsClipboardImpl clipboard = new SimanticsClipboardImpl();
- ch.copyToClipboard(graph, clipboard);
+ ch.copyToClipboard(graph, clipboard, SubMonitor.convert(monitor, 85));
return clipboard;
}
});
for (Set<Representation> object : clipboard.getContents()) {
TransferableGraph1 tg = ClipboardUtils.accept(object, SimanticsKeys.KEY_TRANSFERABLE_GRAPH);
- monitor.worked(95);
+ monitor.worked(10);
monitor.setTaskName("Writing transferable graph...");
DataContainers.writeFile(location, new DataContainer(
*******************************************************************************/
package org.simantics.db.layer0.adapter;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.simantics.db.ReadGraph;
import org.simantics.db.exception.DatabaseException;
import org.simantics.db.layer0.util.SimanticsClipboardBuilder;
public interface CopyHandler {
- void copyToClipboard(ReadGraph graph, SimanticsClipboardBuilder clipboard) throws DatabaseException;
- void cutToClipboard(ReadGraph graph, SimanticsClipboardBuilder clipboard) throws DatabaseException;
+ void copyToClipboard(ReadGraph graph, SimanticsClipboardBuilder clipboard, IProgressMonitor monitor) throws DatabaseException;
+ void cutToClipboard(ReadGraph graph, SimanticsClipboardBuilder clipboard, IProgressMonitor monitor) throws DatabaseException;
}
import java.util.HashSet;
import java.util.Map;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.SubMonitor;
import org.simantics.db.ReadGraph;
import org.simantics.db.Resource;
import org.simantics.db.common.request.ResourceRead;
import org.simantics.graph.db.TransferableGraphs;
import org.simantics.graph.representation.TransferableGraph1;
import org.simantics.operation.Layer0X;
+import org.slf4j.LoggerFactory;
public class DefaultCopyHandler implements CopyHandler, CopyHandler2 {
+ private static final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(DefaultCopyHandler.class);
+
protected Collection<Resource> resources;
public DefaultCopyHandler(Resource resource) {
};
}
- protected void fillTG(ReadGraph graph, HashSet<Representation> items, boolean cut) {
-
+ protected void fillTG(ReadGraph graph, HashSet<Representation> items, boolean cut, IProgressMonitor monitor) {
+ SubMonitor subMonitor = SubMonitor.convert(monitor, 10);
+ subMonitor.subTask("Fill tg");
try {
Representation tgRepresentation = createTransferableGraph(graph, resources, cut);
- if(tgRepresentation != null) items.add(tgRepresentation);
+ if (tgRepresentation != null)
+ items.add(tgRepresentation);
+ subMonitor.worked(2);
Representation tgSourceRepresentation = createTransferableGraphSource(graph, resources, cut);
- if(tgSourceRepresentation != null) items.add(tgSourceRepresentation);
-
- if(resources.size() == 1) {
- Collection<Representation> representations = graph.syncRequest(new ResourceRead<Collection<Representation>>(resources.iterator().next()) {
- @Override
- public Collection<Representation> perform(ReadGraph graph) throws DatabaseException {
- ArrayList<Representation> result = new ArrayList<Representation>();
- Layer0X L0X = Layer0X.getInstance(graph);
- for(Resource adapter : graph.getObjects(resource, L0X.HasRepresentation)) {
- result.add(graph.adapt(adapter, Representation.class));
- }
- return result;
- }
- });
+ if (tgSourceRepresentation != null)
+ items.add(tgSourceRepresentation);
+ subMonitor.worked(2);
+
+ if (resources.size() == 1) {
+ SubMonitor splittedChild = subMonitor.split(6);
+ Collection<Representation> representations = graph
+ .syncRequest(new ResourceRead<Collection<Representation>>(resources.iterator().next()) {
+ @Override
+ public Collection<Representation> perform(ReadGraph graph) throws DatabaseException {
+ ArrayList<Representation> result = new ArrayList<Representation>();
+ Layer0X L0X = Layer0X.getInstance(graph);
+ for (Resource adapter : graph.getObjects(resource, L0X.HasRepresentation)) {
+ result.add(graph.adapt(adapter, Representation.class));
+ splittedChild.worked(1);
+ }
+ return result;
+ }
+ });
for (Representation r : representations)
items.add(r);
+ } else {
+ LOGGER.warn("Invalid amount of resources {} for filling tg", resources);
}
} catch (DatabaseException e) {
}
- protected void fillCopyResource(ReadGraph graph, HashSet<Representation> items) {
+ protected void fillCopyResource(ReadGraph graph, HashSet<Representation> items, IProgressMonitor monitor) {
+ SubMonitor subMonitor = SubMonitor.convert(monitor, 1);
+ subMonitor.subTask("Fill copy resources");
items.add(ClipboardUtils.createCopyResources(resources));
+ subMonitor.worked(1);
}
- protected void fillCutResource(ReadGraph graph, HashSet<Representation> items) {
+ protected void fillCutResource(ReadGraph graph, HashSet<Representation> items, IProgressMonitor monitor) {
+ SubMonitor subMonitor = SubMonitor.convert(monitor, 1);
+ subMonitor.subTask("Fill cut resources");
items.add(ClipboardUtils.createCutResources(resources));
+ subMonitor.worked(1);
}
@Override
- public void copyToClipboard(ReadGraph graph, SimanticsClipboardBuilder clipboard) throws DatabaseException {
+ public void copyToClipboard(ReadGraph graph, SimanticsClipboardBuilder clipboard, IProgressMonitor monitor) throws DatabaseException {
+ SubMonitor subMonitor = SubMonitor.convert(monitor, 100);
HashSet<Representation> items = new HashSet<Representation>();
- fillTG(graph, items, false);
- fillCopyResource(graph, items);
- clipboard.addContent(items);
+ fillTG(graph, items, false, subMonitor.split(80));
+ fillCopyResource(graph, items, subMonitor.split(10));
+ clipboard.addContent(items, subMonitor.split(10));
}
@Override
- public void cutToClipboard(ReadGraph graph, SimanticsClipboardBuilder clipboard) throws DatabaseException {
+ public void cutToClipboard(ReadGraph graph, SimanticsClipboardBuilder clipboard, IProgressMonitor monitor) throws DatabaseException {
+ SubMonitor subMonitor = SubMonitor.convert(monitor, 100);
HashSet<Representation> items = new HashSet<Representation>();
- fillTG(graph, items, true);
- fillCutResource(graph, items);
- clipboard.addContent(items);
+ fillTG(graph, items, true, subMonitor.split(80));
+ fillCutResource(graph, items, subMonitor.split(10));
+ clipboard.addContent(items, subMonitor.split(10));
}
}
public static Collection<Resource> copyTo(WriteGraph graph, Resource targetContainer, PasteEventHandler handler, CopyHandler copyHandler, PasteHandler pasteHandler) throws DatabaseException {
SimanticsClipboardImpl clipboard = new SimanticsClipboardImpl();
- copyHandler.copyToClipboard(graph, clipboard);
+ copyHandler.copyToClipboard(graph, clipboard, new NullProgressMonitor());
if(targetContainer != null) {
if(pasteHandler == null) pasteHandler = graph.adapt(targetContainer, PasteHandler.class);
return pasteHandler.pasteFromClipboard(graph, clipboard, handler);
SimanticsClipboardImpl cp = new SimanticsClipboardImpl();
CopyHandler c1 = graph.adapt(r, CopyHandler.class);
- c1.copyToClipboard(graph, cp);
+ c1.copyToClipboard(graph, cp, null);
Collection<Set<Representation>> reps = cp.getContents();
if(reps.size() != 1) return null;
return ClipboardUtils.accept(graph, reps.iterator().next(), SimanticsKeys.KEY_TRANSFERABLE_GRAPH);
SimanticsClipboardImpl cp = new SimanticsClipboardImpl();
CopyHandler c1 = graph.adapt(r, CopyHandler.class);
- c1.copyToClipboard(graph, cp);
+ c1.copyToClipboard(graph, cp, null);
Collection<Set<Representation>> reps = cp.getContents();
if(reps.size() != 1) return null;
return ClipboardUtils.accept(graph, reps.iterator().next(), SimanticsKeys.KEY_TRANSFERABLE_GRAPH_SOURCE);
import java.util.Map;
import java.util.Set;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.simantics.databoard.Bindings;
import org.simantics.databoard.adapter.AdaptException;
import org.simantics.databoard.binding.Binding;
if(uri == null) continue;
CopyHandler ch = graph.adapt(library, CopyHandler.class);
SimanticsClipboardImpl clipboard = new SimanticsClipboardImpl();
- ch.copyToClipboard(graph, clipboard);
+ ch.copyToClipboard(graph, clipboard, new NullProgressMonitor());
for (Set<Representation> object : clipboard.getContents()) {
TransferableGraph1 tg = ClipboardUtils.accept(graph, object, SimanticsKeys.KEY_TRANSFERABLE_GRAPH);
if(tg != null) {
import java.util.Set;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.simantics.db.layer0.util.SimanticsClipboard.Representation;
public interface SimanticsClipboardBuilder {
- void addContent(Set<Representation> content);
+ void addContent(Set<Representation> content, IProgressMonitor monitor);
}
import java.util.Collections;
import java.util.Set;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.simantics.utils.datastructures.collections.CollectionUtils;
final public class SimanticsClipboardImpl implements SimanticsClipboard, SimanticsClipboardBuilder {
}
public SimanticsClipboardImpl(Representation representation) {
- addContent(Collections.singleton(representation));
+ addContent(Collections.singleton(representation), new NullProgressMonitor());
}
public SimanticsClipboardImpl(Representation ... representation) {
- addContent(CollectionUtils.toSet(representation));
+ addContent(CollectionUtils.toSet(representation), new NullProgressMonitor());
}
@Override
}
@Override
- public void addContent(Set<Representation> content) {
+ public void addContent(Set<Representation> content, IProgressMonitor monitor) {
objects.add(content);
}
import java.util.Map;
import java.util.Set;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.simantics.databoard.Bindings;
import org.simantics.databoard.binding.mutable.Variant;
import org.simantics.db.ReadGraph;
return resource;
}
};
- handler.copyToClipboard(graph, builder);
+ handler.copyToClipboard(graph, builder, new NullProgressMonitor());
for(Set<SimanticsClipboard.Representation> object : builder.getContents()) {
TransferableGraph1 tg = ClipboardUtils.accept(graph, object, SimanticsKeys.KEY_TRANSFERABLE_GRAPH);
TransferableGraphs.importGraph1(graph, tg, advisor);
import java.util.Set;
import java.util.function.BiFunction;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.simantics.databoard.Bindings;
import org.simantics.databoard.binding.Binding;
import org.simantics.databoard.type.Datatype;
*/
public static Resource copy4(WriteGraph graph, Resource source, CopyHandler copyHandler) throws DatabaseException {
SimanticsClipboardImpl builder = new SimanticsClipboardImpl();
- copyHandler.copyToClipboard(graph, builder);
+ copyHandler.copyToClipboard(graph, builder, new NullProgressMonitor());
for(Set<Representation> object : builder.getContents()) {
TransferableGraph1 tg = ClipboardUtils.accept(graph, object, SimanticsKeys.KEY_TRANSFERABLE_GRAPH);
org.simantics.modeling.template2d.ontology;bundle-version="1.0.0",
org.simantics.annotation.ontology;bundle-version="1.0.0",
org.simantics.graph.db;bundle-version="[1.1.9,2.0.0)",
- org.simantics.export.core;bundle-version="1.0.0"
+ org.simantics.export.core;bundle-version="1.0.0",
+ org.slf4j.api
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Export-Package: org.simantics.modeling.template2d.ui.function
import java.util.Set;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.SubMonitor;
import org.osgi.service.prefs.Preferences;
import org.simantics.databoard.binding.mutable.Variant;
import org.simantics.databoard.type.RecordType;
) throws ExportException {
final TransferableGraphWriter writer = (TransferableGraphWriter) writer_;
-
+ SubMonitor ss = SubMonitor.convert(monitor, 2);
try {
List<Resource> resources = context.session.syncRequest( ExportQueries.toResources2(contents) );
+ SubMonitor subMonitor = ss.split(resources.size());
for ( final Resource model : resources ) {
// TODO: figure out a way to make the TG go directly into a file
// instead of having it all in memory at once.
public SimanticsClipboard perform(ReadGraph graph) throws DatabaseException {
CopyHandler ch = graph.adapt( model, CopyHandler.class );
SimanticsClipboardImpl clipboard = new SimanticsClipboardImpl();
- ch.copyToClipboard(graph, clipboard);
+ ch.copyToClipboard(graph, clipboard, subMonitor.split(1));
return clipboard;
}
});
+ SubMonitor subMonitor2 = ss.split(resources.size());
for (Set<Representation> object : clipboard.getContents()) {
TransferableGraph1 tg = ClipboardUtils.accept(object, SimanticsKeys.KEY_TRANSFERABLE_GRAPH);
writer.writeFile(TransferableGraph1.BINDING, tg);
+ subMonitor2.worked(1);
}
}
import org.simantics.db.ReadGraph;
import org.simantics.db.Resource;
import org.simantics.db.Session;
-import org.simantics.db.common.utils.Logger;
import org.simantics.db.exception.DatabaseException;
import org.simantics.db.layer0.adapter.CopyHandler;
import org.simantics.db.layer0.util.ClipboardUtils;
import org.simantics.graph.representation.TransferableGraph1;
import org.simantics.modeling.template2d.DiagramTemplateConstants;
import org.simantics.utils.ui.dialogs.ShowMessage;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* @author Tuukka Lehtonen
- * @author Teemu Mätäsniemi
+ * @author Teemu M�t�sniemi
*/
public class DrawingTemplateExporter implements IRunnableWithProgress {
+ private static final Logger LOGGER = LoggerFactory.getLogger(DrawingTemplateExporter.class);
+
ExportPlan exportModel;
public DrawingTemplateExporter(ExportPlan exportModel) {
public SimanticsClipboard perform(ReadGraph graph) throws DatabaseException {
CopyHandler ch = graph.adapt(template, CopyHandler.class);
SimanticsClipboardImpl clipboard = new SimanticsClipboardImpl();
- ch.copyToClipboard(graph, clipboard);
+ ch.copyToClipboard(graph, clipboard, SubMonitor.convert(mon, 50));
return clipboard;
}
});
for (Set<Representation> object : clipboard.getContents()) {
TransferableGraph1 tg = ClipboardUtils.accept(object, SimanticsKeys.KEY_TRANSFERABLE_GRAPH);
- mon.worked(95);
+ mon.worked(50);
mon.setTaskName("Writing transferable graph...");
DataContainers.writeFile(location, new DataContainer(
DiagramTemplateConstants.DRAWING_TEMPLATE_FORMAT, DiagramTemplateConstants.DRAWING_TEMPLATE_CURRENT_VERSION,
new Variant(TransferableGraph1.BINDING, tg)));
-
mon.worked(5);
}
-
} catch (DatabaseException e) {
- e.printStackTrace();
- Logger.defaultLogError(e);
+ LOGGER.error("Drawing template export failed", e);
mon.setCanceled(true);
ShowMessage.showError("Export failed.", "Internal application error in export. See log for details.");
}
import java.util.Collection;
import java.util.List;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.viewers.ISelection;
import org.simantics.db.Resource;
import org.simantics.modeling.ui.modelBrowser.handlers.StandardCopyHandler;
ISelection selection = ISelectionUtils.createSelection(node);
Resource[] rs = new Resource[] {node};
- StandardCopyHandler.copyResourcesToClipboard(rs, selection);
+ StandardCopyHandler.copyResourcesToClipboard(rs, selection, new NullProgressMonitor());
}
public static void pasteNode (Resource target) {
import java.util.Collection;
import java.util.Collections;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
import org.simantics.db.Resource;
import org.simantics.db.layer0.adapter.ActionFactory;
import org.simantics.db.layer0.adapter.ActionFactory2;
return null;
resources.add((Resource)o);
}
-
- return new Runnable() {
- @Override
- public void run() {
-
- StandardCopyHandler.copyResourcesToClipboard(resources.toArray(new Resource[resources.size()]), null);
-
- }
+ return () -> {
+ Job job = new Job("Copy") {
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ StandardCopyHandler.copyResourcesToClipboard(resources.toArray(new Resource[resources.size()]), null, monitor);
+ return Status.OK_STATUS;
+ }
+ };
+ job.setUser(true);
+ job.schedule();
};
}
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.SubMonitor;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.action.IStatusLineManager;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.StructuredSelection;
if(copyText(selection)) return null;
formatSelectionToClipboardText(event);
-
final Resource[] rs = ResourceAdaptionUtils.toResources(selection);
- copyResourcesToClipboard(rs, selection);
+ Job job = new Job("Copy resources") {
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ monitor.beginTask("Copy resources to clipboard", 1);
+ copyResourcesToClipboard(rs, selection, SubMonitor.convert(monitor, 1));
+ return null;
+ }
+ };
+ job.setUser(true);
+ job.schedule();
+
return null;
}
- public static String copyResourcesToClipboard(final Resource[] rs, ISelection selection) {
+ public static String copyResourcesToClipboard(final Resource[] rs, ISelection selection, IProgressMonitor monitor) {
if(rs == null || rs.length == 0) {
// This support was added for copying of properties (variables)
if(!variables.isEmpty()) {
final SimanticsClipboardImpl builder = new SimanticsClipboardImpl();
for(Variable var : variables) {
- builder.addContent(Collections.singleton(ClipboardUtils.createVariable(Simantics.getSession(), var)));
+ builder.addContent(Collections.singleton(ClipboardUtils.createVariable(Simantics.getSession(), var)), monitor);
}
Simantics.setClipboard(builder);
setCopyMessage(builder.getContents().size(), "variable");
public void run(ReadGraph graph) throws DatabaseException {
for (Resource r : rs) {
CopyHandler handler = graph.adapt(r, CopyHandler.class);
- handler.copyToClipboard(graph, builder);
+ handler.copyToClipboard(graph, builder, monitor);
}
}
});
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubMonitor;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.action.IStatusLineManager;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.PlatformUI;
setStatus("Nothing to cut.");
return null;
}
-
- try {
- final SimanticsClipboardImpl builder = new SimanticsClipboardImpl();
-
- Simantics.getSession().syncRequest(new ReadRequest() {
- @Override
- public void run(ReadGraph graph) throws DatabaseException {
- Set<Resource> unique = new HashSet<Resource>();
- for (Resource r : rs) {
- if (!unique.add(r))
- continue;
- CopyHandler handler = graph.adapt(r, CopyHandler.class);
- handler.cutToClipboard(graph, builder);
- }
+ Job job = new Job("Cut resources") {
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ monitor.beginTask("Cut resources", rs.length);
+ try {
+ final SimanticsClipboardImpl builder = new SimanticsClipboardImpl();
+
+ Simantics.getSession().syncRequest(new ReadRequest() {
+ @Override
+ public void run(ReadGraph graph) throws DatabaseException {
+ Set<Resource> unique = new HashSet<Resource>();
+ for (Resource r : rs) {
+ if (!unique.add(r))
+ continue;
+ CopyHandler handler = graph.adapt(r, CopyHandler.class);
+ handler.cutToClipboard(graph, builder, SubMonitor.convert(monitor, 1));
+ }
+ }
+ });
+
+ Simantics.setClipboard(builder);
+ setCutMessage(builder.getContents().size(), "resource");
+
+ } catch (DatabaseException e) {
+ Logger.defaultLogError(e);
}
- });
-
- Simantics.setClipboard(builder);
- setCutMessage(builder.getContents().size(), "resource");
-
- } catch (DatabaseException e) {
- Logger.defaultLogError(e);
- }
+ return Status.OK_STATUS;
+ }
+ };
+ job.setUser(true);
+ job.schedule();
return null;
}
public void run(ReadGraph graph) throws DatabaseException {
for (Resource r : rs) {
CopyHandler handler = graph.adapt(r, CopyHandler.class);
- handler.cutToClipboard(graph, builder);
+ handler.cutToClipboard(graph, builder, null);
}
}
});
String uri = graph.getURI(r);
SimanticsClipboardImpl clipboard = new SimanticsClipboardImpl();
- ch.copyToClipboard(graph, clipboard);
+ ch.copyToClipboard(graph, clipboard, monitor);
for (Set<Representation> object : clipboard.getContents()) {
TransferableGraph1 tg = ClipboardUtils.accept(graph, object, SimanticsKeys.KEY_TRANSFERABLE_GRAPH);
if (tg != null)
public static TransferableGraph1 exportSharedOntology(IProgressMonitor monitor, RequestProcessor processor, File location, String format, int version, final LibraryInfo info) throws DatabaseException, IOException {
if(monitor == null) monitor = new NullProgressMonitor();
-
+ final IProgressMonitor finalMonitor = monitor;
// TODO: figure out a way to make the TG go directly into a file
// instead of having it all in memory at once.
public SimanticsClipboard perform(ReadGraph graph) throws DatabaseException {
CopyHandler ch = graph.adapt(info.library.getResource(), CopyHandler.class);
SimanticsClipboardImpl clipboard = new SimanticsClipboardImpl();
- ch.copyToClipboard(graph, clipboard);
+ ch.copyToClipboard(graph, clipboard, finalMonitor);
return clipboard;
}
});
import java.util.Map;
import java.util.Set;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.simantics.db.ReadGraph;
import org.simantics.db.Resource;
import org.simantics.db.WriteGraph;
ComponentAndElementPasteImportAdvisor advisor = new ComponentAndElementPasteImportAdvisor(graph, targetContainer, false,true);
- handler.copyToClipboard(graph, builder);
+ handler.copyToClipboard(graph, builder, new NullProgressMonitor());
for(Set<Representation> object : builder.getContents()) {
TransferableGraph1 tg = ClipboardUtils.accept(graph, object, SimanticsKeys.KEY_TRANSFERABLE_GRAPH);
if(tg != null) {
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Consumer;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.simantics.NameLabelMode;
import org.simantics.NameLabelUtil;
import org.simantics.Simantics;
CommonDBUtils.selectClusterSet(graph, target);
SimanticsClipboardImpl clipboard = new SimanticsClipboardImpl();
CopyHandler ch = new TypicalCompositeCopyHandler(template.getResource());
- ch.copyToClipboard(graph, clipboard);
+ ch.copyToClipboard(graph, clipboard, new NullProgressMonitor());
Map<String,Object> hints = Collections.singletonMap(ClipboardUtils.HINT_TARGET_RESOURCE, target);