1 package org.simantics.modeling.ui.actions;
3 import org.simantics.Simantics;
4 import org.simantics.db.Resource;
5 import org.simantics.db.WriteGraph;
6 import org.simantics.db.common.request.WriteResultRequest;
7 import org.simantics.db.exception.DatabaseException;
8 import org.simantics.modeling.ModelingResources;
11 * @author Tuukka Lehtonen
13 public class NewLocalLibrary extends NewLibrary {
15 protected Resource createLocalLibrary(WriteGraph graph, Resource parent)
16 throws DatabaseException {
17 Resource lib = super.createLibrary(graph, parent);
18 ModelingResources MOD = ModelingResources.getInstance(graph);
19 graph.claim(lib, MOD.IsLocalLibraryOf, parent);
24 public Resource newLibrary(final Resource model) throws DatabaseException {
25 Resource library = Simantics.getSession().syncRequest(new WriteResultRequest<Resource>() {
28 public Resource perform(WriteGraph graph) throws DatabaseException {
29 Resource library = createLocalLibrary(graph, model);