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%2Fadapters%2FCompositeCopyHandler.java;h=8c91852cdd83b143189290654b0fa814f4b7fa79;hp=6167334fdd79815ad98a60cb1db1762d611a116f;hb=refs%2Fchanges%2F02%2F1402%2F2;hpb=dbe0a77f0869111219b69d412d0bb90d17c391c1 diff --git a/bundles/org.simantics.modeling/src/org/simantics/modeling/adapters/CompositeCopyHandler.java b/bundles/org.simantics.modeling/src/org/simantics/modeling/adapters/CompositeCopyHandler.java index 6167334fd..8c91852cd 100644 --- a/bundles/org.simantics.modeling/src/org/simantics/modeling/adapters/CompositeCopyHandler.java +++ b/bundles/org.simantics.modeling/src/org/simantics/modeling/adapters/CompositeCopyHandler.java @@ -26,7 +26,8 @@ import org.simantics.db.function.DbConsumer; import org.simantics.db.layer0.adapter.SubgraphExtent.ExtentStatus; import org.simantics.db.layer0.adapter.impl.DefaultCopyHandler; import org.simantics.db.layer0.util.TransferableGraphConfiguration2; -import org.simantics.db.layer0.util.TransferableGraphConfiguration2.RootSpec; +import org.simantics.db.layer0.util.TransferableGraphConfiguration2.SeedSpec; +import org.simantics.db.layer0.util.TransferableGraphConfiguration2.SeedSpec.SeedSpecType; import org.simantics.diagram.stubs.DiagramResource; import org.simantics.layer0.Layer0; import org.simantics.modeling.ModelingResources; @@ -59,7 +60,7 @@ public class CompositeCopyHandler extends DefaultCopyHandler { ? (Set) resources : new HashSet<>(resources); Set exclusions = new HashSet<>(); Set externals = new HashSet<>(); - List roots = new ArrayList<>(); + List roots = new ArrayList<>(); Resource indexRoot = graph.syncRequest(new PossibleIndexRoot(resources.iterator().next())); if(indexRoot == null) throw new DatabaseException("Composite is not part of any index root"); @@ -143,17 +144,17 @@ public class CompositeCopyHandler extends DefaultCopyHandler { // Include resource as root CompositeInfo info = CompositeInfo.fromResource(graph, resource); - roots.add(new RootSpec(resource, info.getTGName(), true, typeId(graph, L0, indexRootUri, resource))); + roots.add(new SeedSpec(resource, info.getTGName(), SeedSpecType.ROOT, typeId(graph, L0, indexRootUri, resource))); identifierExcluder.accept(resource); // Include components as roots for (Resource child : graph.sync(new ObjectsWithType(resource, L0.ConsistsOf, SR.Component))) { DiagramComponentInfo cinfo = DiagramComponentInfo.fromResource(graph, info, child); identifierExcluder.accept(child); - roots.add(new RootSpec(child, cinfo.getTGName(info), true, typeId(graph, L0, indexRootUri, child))); + roots.add(new SeedSpec(child, cinfo.getTGName(info), SeedSpecType.ROOT, typeId(graph, L0, indexRootUri, child))); } } - roots.add(new RootSpec(indexRoot, "%model", false)); + roots.add(new SeedSpec(indexRoot, "%model", SeedSpecType.SPECIAL_ROOT)); TransferableGraphConfiguration2 config = TransferableGraphConfiguration2.createWithNames2(graph, roots, exclusions, true, false); for (Resource external : externals)