import org.simantics.db.exception.DatabaseException;
import org.simantics.db.procedure.SyncListener;
import org.simantics.db.request.Read;
+import org.simantics.db.request.ReadExt;
+import org.simantics.db.request.RequestFlags;
import org.simantics.layer0.Layer0;
import org.simantics.modeling.ModelingUtils;
import org.simantics.modeling.internal.Activator;
}
}
+ static class PossibleResourceIU extends UnaryRead<String,Resource> implements ReadExt {
+
+ public PossibleResourceIU(String parameter) {
+ super(parameter);
+ }
+
+ @Override
+ public Resource perform(ReadGraph graph) throws DatabaseException {
+ return graph.getPossibleResource(parameter);
+ }
+
+ @Override
+ public boolean isImmutable(ReadGraph graph) throws DatabaseException {
+ return false;
+ }
+
+ @Override
+ public int getType() {
+ return RequestFlags.IMMEDIATE_UPDATE;
+ }
+
+ }
+
static class ReadModuleSource extends UnaryRead<String, ModuleSource> {
public ReadModuleSource(String moduleName) {
super(moduleName);
@Override
public ModuleSource perform(ReadGraph graph) throws DatabaseException {
- Resource moduleResource = graph.getPossibleResource(parameter);
+ Resource moduleResource = graph.syncRequest(new PossibleResourceIU(parameter));
if(moduleResource == null)
return null;
Layer0 L0 = Layer0.getInstance(graph);