]> gerrit.simantics Code Review - simantics/platform.git/blob
897aa85152c3449c32f012d7f31932aea8245ef4
[simantics/platform.git] /
1 package org.simantics.modeling.ui.diagram.monitor;
2
3 import org.simantics.browsing.ui.swt.widgets.impl.ReadFactoryImpl;
4 import org.simantics.db.ReadGraph;
5 import org.simantics.db.Resource;
6 import org.simantics.db.exception.DatabaseException;
7 import org.simantics.operation.Layer0X;
8
9 public class CurrentExpressionFactory extends ReadFactoryImpl<Resource, String> {
10
11         @Override
12         public String perform(ReadGraph graph, Resource monitor) throws DatabaseException {
13                 
14                 Layer0X L0X = Layer0X.getInstance(graph);
15                 String exp = graph.getPossibleRelatedAdapter(monitor, L0X.HasExpression, String.class);
16                 return exp != null ? exp : "value";
17                 
18         }
19         
20 }