import org.simantics.db.common.request.BinaryRead;
import org.simantics.db.common.request.ObjectsWithType;
import org.simantics.db.common.request.UnaryRead;
+import org.simantics.db.common.request.WriteRequest;
import org.simantics.db.common.utils.LiteralFileUtil;
import org.simantics.db.exception.DatabaseException;
import org.simantics.db.exception.ServiceException;
});
}
+ @Override
+ public void modify(Object context, Variant newValue) {
+
+ Simantics.getSession().asyncRequest(new WriteRequest() {
+
+ @Override
+ public void perform(WriteGraph graph) throws DatabaseException {
+ Variable variable = Variables.getVariable(graph, uri);
+ variable.setValue(graph, newValue);
+ }
+ });
+
+ }
+
}
public static Variant extRefActiveVariable(ReadGraph graph, Variable var) throws DatabaseException {
});
}
+ @Override
+ public void modify(Object context, Variant newValue) {
+
+ Simantics.getSession().asyncRequest(new WriteRequest() {
+
+ @Override
+ public void perform(WriteGraph graph) throws DatabaseException {
+ Variable contextVariable = Variables.getVariable(graph, (String)context);
+ Variable configVariable = Variables.getVariable(graph,uri);
+ Variable activeVariable = Variables.switchPossibleContext(graph, configVariable, contextVariable.getRepresents(graph));
+ if(activeVariable == null) return;
+ activeVariable.setValue(graph, newValue.getValue(), newValue.getBinding());
+ }
+ });
+
+ }
+
}
public static CellEditor cellEditor(ReadGraph graph, Resource sheet) throws DatabaseException {