From: lempinen Date: Tue, 21 Sep 2010 07:47:17 +0000 (+0000) Subject: git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@18016 ac1ea38d-2e2b... X-Git-Tag: simantics-1.2.0~33 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=21baee5f5d735e4f9856705047c798ce120b5b0a;p=simantics%2Fsysdyn.git git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@18016 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.sysdyn.ontology/graph.tg b/org.simantics.sysdyn.ontology/graph.tg index dc292452..c972fb75 100644 Binary files a/org.simantics.sysdyn.ontology/graph.tg and b/org.simantics.sysdyn.ontology/graph.tg differ diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ExperimentsFolder.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ExperimentsFolder.java index e8b22350..034a1be6 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ExperimentsFolder.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ExperimentsFolder.java @@ -20,7 +20,7 @@ public class ExperimentsFolder extends AbstractNode { super(resource); } - @SuppressWarnings("unchecked") + @SuppressWarnings("rawtypes") @Override public Object getAdapter(Class adapter) { if(clazz == adapter) // There is no resource for this node.. diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ModulesNode.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ModulesNode.java index d52ab4f2..f3c0e3f0 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ModulesNode.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/nodes/ModulesNode.java @@ -20,7 +20,7 @@ public class ModulesNode extends AbstractNode { super(resource); } - @SuppressWarnings("unchecked") + @SuppressWarnings("rawtypes") @Override public Object getAdapter(Class adapter) { if(clazz == adapter) // There is no resource for this node.. diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/ExportModelHandler.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/ExportModelHandler.java index 3f65256c..d7617ba7 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/ExportModelHandler.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/ExportModelHandler.java @@ -42,24 +42,30 @@ public class ExportModelHandler extends AbstractHandler { // FIXME: Model browser doesn't change its selection even if the selected object is removed, // so you can try to export a removed model - boolean isRemoved = true; + String name = null; try { - isRemoved = SimanticsUI.getSession().syncRequest(new Read() { + name = SimanticsUI.getSession().syncRequest(new Read() { @Override - public Boolean perform(ReadGraph graph) throws DatabaseException { - return !graph.hasStatement(model, Layer0.getInstance(graph).PartOf); + public String perform(ReadGraph graph) throws DatabaseException { + if (!graph.hasStatement(model, Layer0.getInstance(graph).PartOf)) + return null; + Layer0 l0 = Layer0.getInstance(graph); + String name = graph.syncRequest(new PossibleRelatedValue(model, l0.HasName, StringBindingDefault.INSTANCE )); + return name; + } }); } catch (DatabaseException e1) { e1.printStackTrace(); } - if(isRemoved) return null; + if(name == null) return null; Shell shell = HandlerUtil.getActiveShellChecked(event); FileDialog fd = new FileDialog(shell, SWT.SAVE); fd.setText("Export.."); + fd.setFileName(name); fd.setFilterPath(Platform.getLocation().toOSString()); String[] filterExt = {"*.tg"}; fd.setFilterExtensions(filterExt); @@ -92,7 +98,6 @@ public class ExportModelHandler extends AbstractHandler { } }); - return null; }