From 213181dc99a11f01a6a661e619fdb8ae624ff429 Mon Sep 17 00:00:00 2001 From: Anner Date: Wed, 21 Aug 2024 16:09:49 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-126773=20fix:=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E4=B8=BB=E9=A2=98=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E9=85=8D=E8=89=B2=E9=A2=84=E8=A7=88=E4=B8=8D=E7=94=9F=E6=95=88?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/JTemplate.java | 29 ++++++++++++------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index 9697113e27..def6cc51fa 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -268,9 +268,14 @@ public abstract class JTemplate> TemplateTheme usingTheme = getTemplateTheme(); boolean isUsingThemeChanged = StringUtils.equals(event.themName, usingTheme.getName()); - if (isUsingThemeChanged && (event.action == TemplateThemeConfig.ThemeConfigAction.REMOVE || - event.action == TemplateThemeConfig.ThemeConfigAction.UPDATE)) { - checkAndResetTheme(); + if (event.action == TemplateThemeConfig.ThemeConfigAction.REMOVE || + event.action == TemplateThemeConfig.ThemeConfigAction.UPDATE) { + if (isUsingThemeChanged) { + checkAndResetTheme(); + } else { + // 修改主题配置,但是没有修改主题名称 , 需要重新保存文件 + fireSuperTargetModified(); + } } } }; @@ -470,6 +475,7 @@ public abstract class JTemplate> /** * 用于 切换工作目录 时的模板资源暂存 + * * @return */ public FILE templateToStashFile4Envchange() { @@ -545,6 +551,7 @@ public abstract class JTemplate> /** * 刷新 模板资源 和 EditingFILE * 仅在切换工作目录,reload模板时使用 + * * @param file */ public void refreshResourceAndEditingFILE(FILE file) { @@ -1785,7 +1792,6 @@ public abstract class JTemplate> } - private CallbackSaveWorker saveAs(boolean showLoc) { FILE editingFILE = this.getEditingFILE(); if (editingFILE == null) { @@ -1975,7 +1981,6 @@ public abstract class JTemplate> } - @Override public void saveDirectly() { if (isSaving()) { @@ -2125,17 +2130,19 @@ public abstract class JTemplate> /** * 获取此模板所使用的tab栏操作类型 + * * @return */ - public String getTemplateTabOperatorType(){ + public String getTemplateTabOperatorType() { return DEFAULT_TAB_OPERATOR; } /** * 当前模板是否可以被保存 + * * @return 是/否 */ - public boolean canBeSaved(){ + public boolean canBeSaved() { return true; } @@ -2144,15 +2151,16 @@ public abstract class JTemplate> * * @return 是/否 */ - public boolean supportCache(){ + public boolean supportCache() { return true; } /** * 获取此模板在tab栏中显示的名称 + * * @return */ - public String getTabShowName(JTemplate jTemplate){ + public String getTabShowName(JTemplate jTemplate) { String name = TemplateUtils.createLockeTemplatedName(jTemplate, jTemplate.getTemplateName()); if (!jTemplate.isSaved() && !name.endsWith(" *")) { name += " *"; @@ -2162,9 +2170,10 @@ public abstract class JTemplate> /** * 切换环境之前是否需要保存 + * * @return */ - public boolean needSaveBeforeSwitchEnv(){ + public boolean needSaveBeforeSwitchEnv() { return false; }