]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Export model, module, and function library ask confirmation on overwriting an existin...
authormiettinen <miettinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Fri, 8 Feb 2013 10:23:27 +0000 (10:23 +0000)
committermiettinen <miettinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Fri, 8 Feb 2013 10:23:27 +0000 (10:23 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@26739 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/exports/ExportFunctionLibrary.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/exports/ExportModelHandler.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/exports/ExportModuleHandler.java

index 5fe78d5925b6210cd574ee0dce49d4619b2b8dd3..7aafb7cfc5f78346e5327dc7381012740477593f 100644 (file)
@@ -48,6 +48,7 @@ import org.simantics.utils.datastructures.Pair;
  * Exports a function library\r
  * \r
  * @author Teemu Lempinen\r
+ * @author Tuomas Miettinen\r
  *\r
  */\r
 public class ExportFunctionLibrary  extends AbstractHandler {\r
@@ -91,6 +92,7 @@ public class ExportFunctionLibrary  extends AbstractHandler {
                fd.setFilterPath(path);\r
                String[] filterExt = {"*.tg"};\r
                fd.setFilterExtensions(filterExt);\r
+               fd.setOverwrite(true);\r
                final String selected = fd.open();\r
                if(selected == null) return null;\r
                \r
index e0040a692a76de2e60a70c23565c7406090136b6..c8c106b14633a31df7f56cc2a145ce3f6b53c38e 100644 (file)
@@ -43,6 +43,7 @@ import org.simantics.ui.utils.ResourceAdaptionUtils;
  * Exports a selected model\r
  * \r
  * @author Teemu Lempinen\r
+ * @author Tuomas Miettinen\r
  *\r
  */\r
 public class ExportModelHandler extends AbstractHandler {\r
@@ -87,6 +88,7 @@ public class ExportModelHandler extends AbstractHandler {
                fd.setFilterPath(path);\r
                String[] filterExt = {"*.tg"};\r
                fd.setFilterExtensions(filterExt);\r
+               fd.setOverwrite(true);\r
                final String selected = fd.open();\r
                if(selected == null) return null;\r
 \r
index 84449b769c7893dc0350fa44244612bd2cc37eb5..cecb5d8b1b0879aee1c5c39298f2936e109dd87e 100644 (file)
@@ -56,6 +56,7 @@ import org.simantics.utils.datastructures.Pair;
 /**\r
  * Exports a selected module\r
  * @author Teemu Lempinen\r
+ * @author Tuomas Miettinen\r
  *\r
  */\r
 public class ExportModuleHandler extends AbstractHandler {\r
@@ -70,7 +71,7 @@ public class ExportModuleHandler extends AbstractHandler {
        class ContainsDependenciesException extends DatabaseException {\r
                private static final long serialVersionUID = -1533706136673146020L;\r
                \r
-               private Collection<String> dependencies;\r
+               private final Collection<String> dependencies;\r
                \r
                ContainsDependenciesException(Collection<String> dependencies) {\r
                        this.dependencies = dependencies;\r
@@ -157,6 +158,7 @@ public class ExportModuleHandler extends AbstractHandler {
                fd.setFilterPath(path);\r
                String[] filterExt = {"*.tg"};\r
                fd.setFilterExtensions(filterExt);\r
+               fd.setOverwrite(true);\r
                final String selected = fd.open();\r
                if(selected == null) return null;\r
                \r