X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.modeling%2Fsrc%2Forg%2Fsimantics%2Fmodeling%2Ftypicals%2FSyncTypicalTemplatesToInstances.java;h=cd326051371169ad70b442b8b986300c336cbce2;hp=55f5aef3dabf1869b305b5376d14633abbcf9850;hb=8e4e41fa135641b23f68e205832e0696951c5f63;hpb=7a7c389f2ffddb4e4170098e4f5facca1fa8b633 diff --git a/bundles/org.simantics.modeling/src/org/simantics/modeling/typicals/SyncTypicalTemplatesToInstances.java b/bundles/org.simantics.modeling/src/org/simantics/modeling/typicals/SyncTypicalTemplatesToInstances.java index 55f5aef3d..cd3260513 100644 --- a/bundles/org.simantics.modeling/src/org/simantics/modeling/typicals/SyncTypicalTemplatesToInstances.java +++ b/bundles/org.simantics.modeling/src/org/simantics/modeling/typicals/SyncTypicalTemplatesToInstances.java @@ -11,9 +11,6 @@ *******************************************************************************/ package org.simantics.modeling.typicals; -import gnu.trove.map.hash.THashMap; -import gnu.trove.set.hash.THashSet; - import java.awt.geom.Point2D; import java.util.ArrayList; import java.util.Collection; @@ -85,6 +82,9 @@ import org.simantics.utils.strings.AlphanumComparator; import org.simantics.utils.strings.EString; import org.simantics.utils.ui.ErrorLogger; +import gnu.trove.map.hash.THashMap; +import gnu.trove.set.hash.THashSet; + /** * A write request that synchronizes typical master templates and their * instances as specified. @@ -210,6 +210,26 @@ public class SyncTypicalTemplatesToInstances extends WriteRequest { private boolean writeLog; + /** + * For SCL API. + * + * @param graph + * @param selectedRules + * @param templates + * @param instances + * @throws DatabaseException + */ + public static void syncTypicals(WriteGraph graph, boolean log, List templates, List instances) throws DatabaseException { + graph.syncRequest( + new SyncTypicalTemplatesToInstances( + null, + templates.toArray(Resource.NONE), + instances.toArray(Resource.NONE), + ALL, + null) + .logging(log)); + } + /** * @param templates typical diagram templates to completely synchronize with * their instances