1 package org.simantics.migration.ui;
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.layer0.SoftwareConfigurationResources;
9 public class IsMigrationPossible implements Test {
12 public boolean isCompatible(Class<?> contentType) {
13 return contentType.equals(Resource.class);
17 public boolean test(ReadGraph graph, Object content) throws DatabaseException {
18 Resource resource = (Resource)content;
19 SoftwareConfigurationResources SC = SoftwareConfigurationResources.getInstance(graph);
21 for(Resource version : graph.getObjects(resource, SC.IsCompatibleWith))
22 if(graph.hasStatement(version, SC.Version_HasUpdate))