1 package org.simantics.db.layer0.util;
5 import org.simantics.db.ReadGraph;
6 import org.simantics.db.RequestProcessor;
7 import org.simantics.db.common.request.UniqueRead;
8 import org.simantics.db.exception.DatabaseException;
9 import org.simantics.db.layer0.util.SimanticsClipboard.Representation;
10 import org.simantics.db.layer0.variable.Variable;
11 import org.simantics.db.layer0.variable.Variables;
12 import org.simantics.utils.datastructures.hints.IHintContext.Key;
14 class VariableRepresentation implements Representation {
18 public VariableRepresentation(String URI) {
24 return SimanticsKeys.KEY_VARIABLE;
27 @SuppressWarnings("unchecked")
29 public <T> T getValue(RequestProcessor processor, Map<String,Object> hints) throws DatabaseException {
30 return (T)processor.syncRequest(new UniqueRead<Variable>() {
32 public Variable perform(ReadGraph graph) throws DatabaseException {
33 return Variables.getVariable(graph, URI);