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