NodeContext ctx = (NodeContext)objects[i]; \r
@SuppressWarnings("unchecked")\r
VariableNode<Resource> vn = (VariableNode<Resource>) ctx.getAdapter(VariableNode.class);\r
- IHintContext context = new AdaptableHintContext(SelectionHints.KEY_MAIN);\r
+ IHintContext context;\r
if(vn != null) {\r
Resource resource = vn.getResource() == null ? vn.data : vn.getResource();\r
+ context = new AdaptableHintContext(SelectionHints.KEY_MAIN, SelectionHints.KEY_SELECTION_PROPERTY);\r
context.setHint(SelectionHints.KEY_MAIN, new BrowserSelection(resource, vn.getURI(), vn.getModel()));\r
+ context.setHint(SelectionHints.KEY_SELECTION_PROPERTY, vn.getVariable());\r
} else {\r
+ context = new AdaptableHintContext(SelectionHints.KEY_MAIN);\r
context.setHint(SelectionHints.KEY_MAIN, objects[i]);\r
}\r
result[i] = context;\r
import org.simantics.db.Resource;\r
import org.simantics.db.common.request.ReadRequest;\r
import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.layer0.variable.Variable;\r
import org.simantics.layer0.Layer0;\r
import org.simantics.sysdyn.SysdynResource;\r
import org.simantics.ui.SimanticsUI;\r
Resource model = null;\r
String uri;\r
Resource resource;\r
+ Variable variable;\r
\r
public VariableNode(Resource resource) {\r
super(resource);\r
\r
@Override\r
public void run(ReadGraph graph) throws DatabaseException {\r
+ \r
+ variable = graph.adapt(data, Variable.class);\r
Layer0 l0 = Layer0.getInstance(graph);\r
SysdynResource sr = SysdynResource.getInstance(graph);\r
\r
public Resource getModel() {\r
return model;\r
}\r
+ \r
+ public Variable getVariable() {\r
+ return variable;\r
+ }\r
\r
public String getName(ReadGraph graph) throws DatabaseException {\r
return (String)graph.getRelatedValue(data, Layer0.getInstance(graph).HasName);\r