import org.simantics.browsing.ui.PrimitiveQueryUpdater;\r
import org.simantics.browsing.ui.BuiltinKeys.LabelerKey;\r
import org.simantics.browsing.ui.common.ColumnKeys;\r
-import org.simantics.browsing.ui.common.ContextMenuInitializer;\r
import org.simantics.browsing.ui.common.EvaluatorData;\r
import org.simantics.browsing.ui.common.EvaluatorDataImpl;\r
import org.simantics.browsing.ui.common.EvaluatorImpl;\r
-import org.simantics.browsing.ui.common.IContextMenuInitializer;\r
import org.simantics.browsing.ui.common.EvaluatorData.Evaluator;\r
import org.simantics.browsing.ui.content.Labeler;\r
import org.simantics.browsing.ui.content.LabelerFactory;\r
import org.simantics.browsing.ui.graph.GraphExplorerView;\r
-import org.simantics.browsing.ui.graph.GraphViewpointFactory;\r
-import org.simantics.browsing.ui.graph.LazyGraphLabeler;\r
+import org.simantics.browsing.ui.graph.impl.GraphViewpointFactory;\r
+import org.simantics.browsing.ui.graph.impl.LazyGraphLabeler;\r
+import org.simantics.browsing.ui.swt.ContextMenuInitializer;\r
+import org.simantics.browsing.ui.swt.IContextMenuInitializer;\r
import org.simantics.db.Builtins;\r
import org.simantics.db.ReadGraph;\r
import org.simantics.db.Resource;\r
protected IContextMenuInitializer getContextMenuInitializer() {\r
return new ContextMenuInitializer("#OntologyExplorerPopup");\r
}\r
- \r
+\r
@Override\r
protected EvaluatorData createEvaluatorData(Session session) {\r
HintContext factoryHints = new HintContext();\r
//if (sessionContext != null)\r
//factoryHints.setHint(IGraphExplorerHints.KEY_SESSION_CONTEXT, sessionContext);\r
- \r
+\r
EvaluatorData data = new EvaluatorDataImpl();\r
data.addEvaluator(Resource.class, createResourceEvaluator(session, factoryHints));\r
return data;\r
\r
private Evaluator createResourceEvaluator(Session session, HintContext factoryHints) {\r
Evaluator evaluator = new EvaluatorImpl();\r
- evaluator.addViewpoint(new GraphViewpointFactory() { \r
+ evaluator.addViewpoint(new GraphViewpointFactory() {\r
@Override\r
protected Collection<?> getChildren(ReadGraph g, Resource r)\r
- throws DatabaseException {\r
+ throws DatabaseException {\r
Builtins b = g.getBuiltins();\r
SysdynResource sr = SysdynResource.getInstance(g);\r
- ArrayList<Resource> result = new ArrayList<Resource>(); \r
+ ArrayList<Resource> result = new ArrayList<Resource>();\r
for(Resource c : g.getObjects(r, b.ConsistsOf)) {\r
- if( g.isInstanceOf(c, sr.Configuration) \r
- || (g.isInstanceOf(c, sr.Variable) &&\r
- !g.isInstanceOf(c, sr.Cloud)\r
- )\r
- )\r
+ if( g.isInstanceOf(c, sr.Configuration)\r
+ || (g.isInstanceOf(c, sr.Variable) &&\r
+ !g.isInstanceOf(c, sr.Cloud)\r
+ )\r
+ )\r
result.add(c);\r
}\r
return result;\r
}\r
}, 1.0);\r
- evaluator.addLabeler(new LabelerFactory() { \r
+ evaluator.addLabeler(new LabelerFactory() {\r
@Override\r
public Labeler create(PrimitiveQueryUpdater updater, final NodeContext context, LabelerKey key) {\r
return new LazyGraphLabeler(updater, context, key) {\r
- \r
+\r
Resource nameResource;\r
- \r
+\r
@Override\r
public Map<String, String> labels(ReadGraph g)\r
- throws DatabaseException {\r
+ throws DatabaseException {\r
Builtins b = g.getBuiltins();\r
nameResource = b.HasName;\r
Resource el = (Resource) context.getConstant(BuiltinKeys.INPUT);\r
for(Resource r : g.getObjects(el, b.HasName))\r
sb.append(g.getValue(r));\r
sb.append(" : ");\r
- for(Resource t : g.getObjects(el, b.InstanceOf)) \r
+ for(Resource t : g.getObjects(el, b.InstanceOf))\r
for(Resource r : g.getObjects(t, b.HasName))\r
sb.append(g.getValue(r));\r
return Collections.singletonMap(ColumnKeys.SINGLE, sb.toString());\r
}\r
- \r
+\r
@Override\r
public Modifier getModifier(String key) {\r
LabelModifier modifier = new LabelModifier(SimanticsUI.getSession(), (Resource) context.getConstant(BuiltinKeys.INPUT), nameResource) {\r
};\r
return modifier;\r
}\r
- }; \r
- } \r
- \r
+ };\r
+ }\r
+\r
}, 1.0);\r
- /*evaluator.addImager(new ImagerFactory() { \r
+ /*evaluator.addImager(new ImagerFactory() {\r
@Override\r
public Imager create(PrimitiveQueryUpdater updater, INodeContext context) {\r
// TODO Auto-generated method stub\r
}\r
});*/\r
return evaluator;\r
- } \r
+ }\r
\r
}\r