]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling/src/org/simantics/modeling/typicals/TypicalUtil.java
Fixed ComponentTypeCommands.setUnit to support unit == null
[simantics/platform.git] / bundles / org.simantics.modeling / src / org / simantics / modeling / typicals / TypicalUtil.java
index 3016311ff9c0411be3eb22cb8b11ab6a440ad960..8aef62c7b2dfe3e6e34d9a8629400fbf245ebedf 100644 (file)
@@ -21,6 +21,7 @@ import java.util.concurrent.Semaphore;
 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;
@@ -169,7 +170,7 @@ public class TypicalUtil {
                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);
 
@@ -260,7 +261,7 @@ public class TypicalUtil {
             if (excludedComponents != null && excludedComponents.contains(component))
                 continue;
             try {
-                String renamed = ComponentNamingUtil.findFreshInstanceName(graph, SimanticsUI.getProject(), configurationRoot, typicalCompositeInstance, component);
+                String renamed = ComponentNamingUtil.findFreshInstanceName(graph, Simantics.getProject(), configurationRoot, typicalCompositeInstance, component);
                 if (DEBUG)
                     System.out.println("Typicals: renamed " + entry.getKey() + " -> " + renamed);
                 graph.claimLiteral(entry.getValue(), L0.HasName, L0.NameOf, renamed, Bindings.STRING);