|
|
|
@ -173,12 +173,13 @@ public class TemplateUtils {
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static void createAndOpenTemplate0(FILE file, String oldPath, boolean createByEditingTemplate, boolean openNewTemplate, @Nullable JTemplate<?, ?> template) { |
|
|
|
|
createTemplate(file, oldPath, createByEditingTemplate).thenApply((Function<Boolean, Void>) aBoolean -> { |
|
|
|
|
if (!aBoolean) { |
|
|
|
|
//备份失败直接返回
|
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* |
|
|
|
|
* @param file 模板文件 |
|
|
|
|
* @param openNewTemplate 是否需要打开新模板 |
|
|
|
|
* @param template 需要关闭的模板 |
|
|
|
|
*/ |
|
|
|
|
private static void openNewTemplate(FILE file, boolean openNewTemplate, @Nullable JTemplate<?, ?> template) { |
|
|
|
|
new SwingWorker<Boolean, Void>() { |
|
|
|
|
@Override |
|
|
|
|
protected Boolean doInBackground() throws Exception { |
|
|
|
@ -189,7 +190,6 @@ public class TemplateUtils {
|
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
protected void done() { |
|
|
|
|
try { |
|
|
|
@ -208,6 +208,13 @@ public class TemplateUtils {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}.execute(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static void createAndOpenTemplate0(FILE file, String oldPath, boolean createByEditingTemplate, boolean openNewTemplate, @Nullable JTemplate<?, ?> template) { |
|
|
|
|
createTemplate(file, oldPath, createByEditingTemplate).thenApply((Function<Boolean, Void>) aBoolean -> { |
|
|
|
|
if (aBoolean) { |
|
|
|
|
openNewTemplate(file, openNewTemplate, template); |
|
|
|
|
} |
|
|
|
|
return null; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|