--- /dev/null
+package org.simantics.browsing.ui.model.tests;\r
+\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.exception.DatabaseException;\r
+\r
+public class HasInstanceOfTest implements Test {\r
+ Resource type;\r
+\r
+ public HasInstanceOfTest(Resource type) {\r
+ this.type = type;\r
+ }\r
+\r
+ @Override\r
+ public boolean isCompatible(Class<?> contentType) {\r
+ return contentType == Resource.class;\r
+ }\r
+\r
+ @Override\r
+ public boolean test(ReadGraph graph, Object content)\r
+ throws DatabaseException {\r
+ return graph.isInstanceOf((Resource)content, type);\r
+ }\r
+ \r
+ \r
+}\r