]> gerrit.simantics Code Review - simantics/platform.git/blob - DocumentOldTest.java
e27536ac8fe366d72e308149e9b23900e73402eb
[simantics/platform.git] / DocumentOldTest.java
1 package org.simantics.document.ui.test;
2
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.document.DocumentResource;
8
9 public class DocumentOldTest implements Test{
10         
11         @Override
12         public boolean isCompatible(Class<?> contentType) {
13                 return contentType == Resource.class;
14         }
15         
16         @Override
17         public boolean test(ReadGraph graph, Object content)
18                         throws DatabaseException {
19                 Resource resource = (Resource)content;
20                 DocumentResource doc = DocumentResource.getInstance(graph);
21                 return graph.hasStatement(resource, doc.HasNewerVersion);
22         }
23
24 }