From b5dd00b22089ef5193e3d4a55d261caef25e607a Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 10 Aug 2020 16:59:42 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-37097=20=E8=BF=9C=E7=A8=8B=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1-=E8=AE=BE=E8=AE=A1=E5=99=A8=E6=89=93=E5=BC=80?= =?UTF-8?q?=E7=9A=84=E4=B8=A4=E4=B8=AA=E6=A8=A1=E6=9D=BF=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E6=98=BE=E7=A4=BA=E6=B7=B7=E4=B9=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/file/HistoryTemplateListCache.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java index 466e919b72..ba1cce5563 100644 --- a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java +++ b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java @@ -370,6 +370,7 @@ public class HistoryTemplateListCache implements CallbackEvent { */ public void load() { FineLoggerFactory.getLogger().info("Env Change Template Loading..."); + JTemplate currentTemplate = null; if (stashFILEMap != null && stashFILEMap.size() != 0) { int size = historyList.size(); for (int i = 0; i < size; i++) { @@ -385,20 +386,24 @@ public class HistoryTemplateListCache implements CallbackEvent { historyList.set(i, template); // 替换当前正在编辑的模板,使用添加并激活的方式,以便使用统一的入口来处理监听事件 if (isCurrentEditingFile(template.getPath())) { - loadCurrentTemplate(template); + currentTemplate = template; } } else { // 当模板为空时 说明是一个新建的未保存模板 但是内存中保存了该模板 可以从中获取 JTemplate jt = historyList.get(i); // 另外如果该模板是正在编辑的模板,需要要激活 if (jt != null && isCurrentEditingFile(jt.getPath())) { - loadCurrentTemplate(jt); + currentTemplate = jt; } } } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } } + // 最后加载当前正在编辑的模板 以保证数据集刷新正常 + if (currentTemplate != null) { + loadCurrentTemplate(currentTemplate); + } stashFILEMap.clear(); MutilTempalteTabPane.getInstance().refreshOpenedTemplate(historyList); MutilTempalteTabPane.getInstance().repaint();