From 5a59f32b5015026fff1a08c8b6d89725e10e0092 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 7 Jan 2020 09:27:42 +0800 Subject: [PATCH] =?UTF-8?q?MOBILE-24787=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E4=B8=8A=E7=AC=AC=E4=B8=80=E6=AC=A1=E6=89=93=E5=BC=80=E5=B7=B2?= =?UTF-8?q?=E6=9C=89=E5=BC=B9=E7=AA=97=E8=AE=BE=E7=BD=AE=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=EF=BC=8C=E5=8F=91=E7=8E=B0=E5=BC=B9=E7=AA=97=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/file/HistoryTemplateListCache.java | 13 +++++++++++++ .../fr/design/gui/frpane/HyperlinkGroupPane.java | 2 ++ 2 files changed, 15 insertions(+) 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 8e75fae0bc..2f9a69b313 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 @@ -386,4 +386,17 @@ public class HistoryTemplateListCache implements CallbackEvent { } FineLoggerFactory.getLogger().info("Env Change Template Loaded."); } + + /** + * 重新载入当前模板,刷新数据/对象 + */ + public void reloadCurrentTemplate() { + JTemplate jt = getCurrentEditingTemplate(); + boolean access = jt != null && jt.getEditingFILE() != null && jt.getEditingFILE().exists(); + if (access) { + closeSelectedReport(jt); + DesignerContext.getDesignerFrame().openTemplate(jt.getEditingFILE()); + } + } + } diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/HyperlinkGroupPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/HyperlinkGroupPane.java index 3f4ae9b2a5..8405ce09ea 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/HyperlinkGroupPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/HyperlinkGroupPane.java @@ -2,6 +2,7 @@ package com.fr.design.gui.frpane; import com.fr.design.ExtraDesignClassManager; import com.fr.design.designer.TargetComponent; +import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.fun.HyperlinkProvider; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.UIListControlPane; @@ -45,6 +46,7 @@ public abstract class HyperlinkGroupPane extends UIListControlPane { @Override public void on(PluginEvent event) { refreshNameableCreator(createNameableCreators()); + HistoryTemplateListCache.getInstance().reloadCurrentTemplate(); } }, new PluginFilter() {