1 package org.simantics.document.linking.ge;
3 import org.simantics.browsing.ui.model.tests.Test;
4 import org.simantics.db.ReadGraph;
5 import org.simantics.db.Resource;
6 import org.simantics.db.exception.DatabaseException;
7 import org.simantics.db.layer0.variable.Variable;
9 public class VariableInstanceOfTest implements Test {
12 public VariableInstanceOfTest(Resource type) {
18 public boolean isCompatible(Class<?> contentType) {
19 return contentType == Variable.class;
23 public boolean test(ReadGraph graph, Object content)
24 throws DatabaseException {
25 Variable variable = (Variable)content;
26 Resource res = variable.getPossibleRepresents(graph);
29 return graph.isInstanceOf(res, type);