]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.procore.ui/src/org/simantics/db/procore/ui/Auxiliary.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.db.procore.ui / src / org / simantics / db / procore / ui / Auxiliary.java
diff --git a/bundles/org.simantics.db.procore.ui/src/org/simantics/db/procore/ui/Auxiliary.java b/bundles/org.simantics.db.procore.ui/src/org/simantics/db/procore/ui/Auxiliary.java
new file mode 100644 (file)
index 0000000..996c468
--- /dev/null
@@ -0,0 +1,45 @@
+package org.simantics.db.procore.ui;\r
+\r
+import java.io.File;\r
+\r
+import org.eclipse.swt.widgets.Shell;\r
+import org.simantics.db.exception.InternalException;\r
+import org.simantics.db.procore.ui.internal.UI;\r
+\r
+public class Auxiliary {\r
+    /**\r
+     * @param shell for the user interface.\r
+     * @param exception thrown from server.\r
+     * @return true if server can be started.\r
+     */\r
+    public static boolean beforeStart(Shell shell, File folder) throws InternalException {\r
+        boolean skipPurge = "true".equals(System.getProperty("org.simantics.db.procore.ui.skipPurge"));\r
+        if (skipPurge)\r
+            return true;\r
+        return UI.purge(shell, folder);\r
+    }\r
+    /**\r
+     * @param shell for the user interface.\r
+     * @param exception thrown from server start.\r
+     * @return true if problem with server start was successfully fixed.\r
+     */\r
+    public static boolean handleStart(Shell shell, InternalException exception) throws InternalException {\r
+        return UI.handleStart(shell, exception);\r
+    }\r
+    /**\r
+     * @param shell for the user interface.\r
+     * @param folder of the database.\r
+     * @return true if deletion was successful.\r
+     */\r
+    public static boolean delete(Shell shell, File folder) {\r
+        return UI.delete(shell, folder);\r
+    }\r
+    /**\r
+     * @param shell for the user interface.\r
+     * @param folder of the database.\r
+     * @return true if purge was successful.\r
+     */\r
+    public static boolean purge(Shell shell, File folder) {\r
+        return UI.purge(shell, folder);\r
+    }\r
+}\r