\r
@Override\r
public String getLabel(ReadGraph graph, ModelNode model) throws DatabaseException {\r
- String name = graph.getPossibleRelatedValue(model.resource, graph.getBuiltins().HasName);\r
- return name == null ? "Model (no name)" : name;\r
+ String label = graph.getPossibleRelatedValue(model.resource, graph.getBuiltins().HasLabel);\r
+ return label == null ? "Model (no name)" : label;\r
}\r
}\r
import org.eclipse.ui.IEditorInput;\r
import org.eclipse.ui.IEditorSite;\r
import org.eclipse.ui.PartInitException;\r
+import org.simantics.db.Builtins;\r
import org.simantics.db.ReadGraph;\r
import org.simantics.db.Resource;\r
import org.simantics.db.Session;\r
new TitleRequest(site.getId(), getResourceInput()) {\r
@Override\r
public String perform(ReadGraph graph) throws DatabaseException {\r
+ Builtins b = graph.getBuiltins();\r
Resource r = graph.getSingleObject(\r
getResourceInput().getResource(),\r
- graph.getBuiltins().IsConfigurationOf);\r
- String n = null;\r
- n = graph.adapt(r, String.class);\r
- return n;\r
+ b.IsConfigurationOf);\r
+ String label = graph.getPossibleRelatedValue(r, b.HasLabel);\r
+ return label;\r
}\r
},\r
new TitleUpdater(site.getShell().getDisplay(), new Callback<String>() {\r
SysdynResource sr = SysdynResource.getInstance(graph);\r
Resource model = graph.newResource();\r
graph.claimValue(model, b.HasName, "Model1");\r
+ graph.claimValue(model, b.HasLabel, "Model1");\r
graph.claim(model, b.InstanceOf, sr.SysdynModel);\r
graph.claim(model, b.PartOf, SimanticsUI.getProject().get());\r
\r
SysdynResource sr = SysdynResource.getInstance(g);\r
Resource model = g.newResource();\r
g.claimValue(model, b.HasName, "Model1");\r
+ g.claimValue(model, b.HasLabel, "Model1");\r
g.claim(model, b.InstanceOf, sr.SysdynModel);\r
g.claim(model, b.PartOf, library);\r
\r