From: miettinen Date: Fri, 21 Feb 2014 11:16:20 +0000 (+0000) Subject: Print Sysdyn model name to satus line when modle is exported. (refs #4742) X-Git-Tag: 1.8.1~129 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=e0f70418f8cb19b44993e6616155bac95cf5bf29;p=simantics%2Fsysdyn.git Print Sysdyn model name to satus line when modle is exported. (refs #4742) git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@28914 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.sysdyn.ui/plugin.xml b/org.simantics.sysdyn.ui/plugin.xml index e90bae08..04104b1c 100644 --- a/org.simantics.sysdyn.ui/plugin.xml +++ b/org.simantics.sysdyn.ui/plugin.xml @@ -1854,7 +1854,6 @@ - () { + + @Override + public String perform(ReadGraph graph) throws DatabaseException { + if (!graph.hasStatement(model, Layer0.getInstance(graph).PartOf)) + return null; + Layer0 l0 = Layer0.getInstance(graph); + return graph.syncRequest(new PossibleRelatedValue(model, l0.HasName, Bindings.STRING )); + } + + }); + + if (modelName != null) + setStatus("Saved model \"" + modelName + "\" to " + fileName); + + } catch (DatabaseException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + /** * Create the export file. * @param model Model which is exported. @@ -236,4 +272,10 @@ public class ExportModelHandler extends AbstractHandler { return selected; } + + protected static void setStatus(final String message) { + if (status != null) + status.setMessage(message); + } + }