]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/request/IsModelActive.java
Index tokenized lowercase versions of name and types for UI searches
[simantics/platform.git] / bundles / org.simantics.db.layer0 / src / org / simantics / db / layer0 / request / IsModelActive.java
1 package org.simantics.db.layer0.request;
2
3 import org.simantics.db.ReadGraph;
4 import org.simantics.db.Resource;
5 import org.simantics.db.common.request.ResourceRead;
6 import org.simantics.db.exception.DatabaseException;
7 import org.simantics.operation.Layer0X;
8
9 public class IsModelActive extends ResourceRead<Boolean> {
10
11     public IsModelActive(Resource resource) {
12         super(resource);
13     }
14
15     @Override
16     public Boolean perform(ReadGraph graph) throws DatabaseException {
17         Resource model = graph.sync(new PossibleModel(resource));
18         if(model == null) return false;
19         return graph.hasStatement(model, Layer0X.getInstance(graph).IsActivatedBy);
20     }
21
22 }