Browse Source

REPORT-92893 锁定的模板,重复另存副本,设计器页面模板内容不更新--方法拆解

newui
John.Ying-应志浩 2 years ago
parent
commit
a042152f1b
  1. 21
      designer-base/src/main/java/com/fr/design/utils/TemplateUtils.java

21
designer-base/src/main/java/com/fr/design/utils/TemplateUtils.java

@ -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;
});
}

Loading…
Cancel
Save