\r
// FIXME: Model browser doesn't change its selection even if the selected object is removed,\r
// so you can try to export a removed model \r
- boolean isRemoved = true;\r
+ String name = null;\r
try {\r
- isRemoved = SimanticsUI.getSession().syncRequest(new Read<Boolean>() {\r
+ name = SimanticsUI.getSession().syncRequest(new Read<String>() {\r
\r
@Override\r
- public Boolean perform(ReadGraph graph) throws DatabaseException {\r
- return !graph.hasStatement(model, Layer0.getInstance(graph).PartOf);\r
+ public String perform(ReadGraph graph) throws DatabaseException {\r
+ if (!graph.hasStatement(model, Layer0.getInstance(graph).PartOf))\r
+ return null;\r
+ Layer0 l0 = Layer0.getInstance(graph);\r
+ String name = graph.syncRequest(new PossibleRelatedValue<String>(model, l0.HasName, StringBindingDefault.INSTANCE ));\r
+ return name;\r
+ \r
}\r
\r
});\r
} catch (DatabaseException e1) {\r
e1.printStackTrace();\r
}\r
- if(isRemoved) return null;\r
+ if(name == null) return null;\r
\r
Shell shell = HandlerUtil.getActiveShellChecked(event);\r
FileDialog fd = new FileDialog(shell, SWT.SAVE);\r
fd.setText("Export..");\r
+ fd.setFileName(name);\r
fd.setFilterPath(Platform.getLocation().toOSString());\r
String[] filterExt = {"*.tg"};\r
fd.setFilterExtensions(filterExt);\r
\r
}\r
});\r
- \r
\r
return null;\r
}\r