]> gerrit.simantics Code Review - simantics/platform.git/blob - 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
1 package org.simantics.db.procore.ui;\r
2 \r
3 import java.io.File;\r
4 \r
5 import org.eclipse.swt.widgets.Shell;\r
6 import org.simantics.db.exception.InternalException;\r
7 import org.simantics.db.procore.ui.internal.UI;\r
8 \r
9 public class Auxiliary {\r
10     /**\r
11      * @param shell for the user interface.\r
12      * @param exception thrown from server.\r
13      * @return true if server can be started.\r
14      */\r
15     public static boolean beforeStart(Shell shell, File folder) throws InternalException {\r
16         boolean skipPurge = "true".equals(System.getProperty("org.simantics.db.procore.ui.skipPurge"));\r
17         if (skipPurge)\r
18             return true;\r
19         return UI.purge(shell, folder);\r
20     }\r
21     /**\r
22      * @param shell for the user interface.\r
23      * @param exception thrown from server start.\r
24      * @return true if problem with server start was successfully fixed.\r
25      */\r
26     public static boolean handleStart(Shell shell, InternalException exception) throws InternalException {\r
27         return UI.handleStart(shell, exception);\r
28     }\r
29     /**\r
30      * @param shell for the user interface.\r
31      * @param folder of the database.\r
32      * @return true if deletion was successful.\r
33      */\r
34     public static boolean delete(Shell shell, File folder) {\r
35         return UI.delete(shell, folder);\r
36     }\r
37     /**\r
38      * @param shell for the user interface.\r
39      * @param folder of the database.\r
40      * @return true if purge was successful.\r
41      */\r
42     public static boolean purge(Shell shell, File folder) {\r
43         return UI.purge(shell, folder);\r
44     }\r
45 }\r