From ab54e761567901e98f73758ffac53e8c7c0b732c Mon Sep 17 00:00:00 2001 From: vito Date: Wed, 23 Jun 2021 16:58:53 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-54308=20=E6=A8=A1=E6=9D=BF=E7=BC=BA?= =?UTF-8?q?=E5=A4=B1=E6=8F=92=E4=BB=B6=E8=AE=BE=E8=AE=A1=E6=94=B9=E8=BF=9B?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E6=8F=90=E4=BE=9B=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/DesignerEnvManager.java | 39 +++++++++++++++---- .../design/actions/file/PreferencePane.java | 12 +++++- .../mainframe/app/DesignerAppUtils.java | 5 +++ 3 files changed, 48 insertions(+), 8 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java index de83d6d7b..97b4d0f6c 100644 --- a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java +++ b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java @@ -199,6 +199,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { private DesignerLoginConfigManager designerLoginConfigManager = DesignerLoginConfigManager.getInstance(); + private boolean showTemplateMissingPlugin = true; + /** * DesignerEnvManager. */ @@ -315,8 +317,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { } LogHandler handler = new LogHandler() { final FileAppender appender = new FileAppender( - new com.fr.third.apache.log4j.PatternLayout("%d{HH:mm:ss} %t %p [%c] %m%n"), - fileName + new com.fr.third.apache.log4j.PatternLayout("%d{HH:mm:ss} %t %p [%c] %m%n"), + fileName ); @Override @@ -621,6 +623,24 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { this.templateTreePaneExpanded = templateTreePaneExpanded; } + /** + * 是否提示模板缺少插件 + * + * @return 提示返回true + */ + public boolean isShowTemplateMissingPlugin() { + return showTemplateMissingPlugin; + } + + /** + * 设置是否提示模板缺少插件 + * + * @param showTemplateMissingPlugin 是否提示 + */ + public void setShowTemplateMissingPlugin(boolean showTemplateMissingPlugin) { + this.showTemplateMissingPlugin = showTemplateMissingPlugin; + } + /** * 知否自动备份 * @@ -1698,7 +1718,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { } } - private void readComponentReuseNotificationInfo(XMLableReader reader){ + private void readComponentReuseNotificationInfo(XMLableReader reader) { reader.readXMLObject(this.notificationInfo); } @@ -1792,6 +1812,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { this.setRecentSelectedConnection(tmpVal); } this.setEmbedServerLazyStartup(reader.getAttrAsBoolean("embedServerLazyStartup", false)); + this.setShowTemplateMissingPlugin(reader.getAttrAsBoolean("showTemplateMissingPlugin", true)); } private void readReportPaneAttributions(XMLableReader reader) { @@ -2060,6 +2081,9 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { if (this.isEmbedServerLazyStartup()) { writer.attr("embedServerLazyStartup", this.isEmbedServerLazyStartup()); } + if (!this.isShowTemplateMissingPlugin()) { + writer.attr("showTemplateMissingPlugin", this.isShowTemplateMissingPlugin()); + } writer.end(); } @@ -2212,11 +2236,12 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { enum XmlHandler { Self; + public void handle(Throwable throwable) { ErrorDialog dialog = new ErrorDialog(null, - Toolkit.i18nText("Fine-Design_Error_Start_Apology_Message"), - Toolkit.i18nText("Fine-Design_Error_Start_Report"), - throwable.getMessage()) { + Toolkit.i18nText("Fine-Design_Error_Start_Apology_Message"), + Toolkit.i18nText("Fine-Design_Error_Start_Report"), + throwable.getMessage()) { @Override protected void okEvent() { dispose(); @@ -2232,5 +2257,5 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { dialog.setVisible(true); DesignerExiter.getInstance().execute(); } - }; + } } diff --git a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java index 5afe58ad3..133bbb03f 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java @@ -40,7 +40,6 @@ import com.fr.general.log.Log4jConfig; import com.fr.locale.InterProviderFactory; import com.fr.log.FineLoggerFactory; import com.fr.stable.Constants; -import com.fr.stable.StableUtils; import com.fr.stable.os.OperatingSystem; import com.fr.third.apache.log4j.Level; import com.fr.transaction.Configurations; @@ -141,6 +140,8 @@ public class PreferencePane extends BasicPane { private UIComboBox maxUndoLimit; //是非支持自动计算父格 private UICheckBox supportDefaultParentCalculateCheckBox; + //打开模板是否提示缺少插件 + private UICheckBox showTemplateMissingPlugin; //是否自动转化为公式 private UICheckBox supportStringToFormulaBox; @@ -361,6 +362,11 @@ public class PreferencePane extends BasicPane { supportDefaultParentCalculateCheckBox = new UICheckBox( i18nText("Fine-Design_Basic_Preference_Support_Default_Parent_Calculate")); functionPane.add(supportDefaultParentCalculateCheckBox); + + //添加是否展示打开模板提示缺少插件选择项 + showTemplateMissingPlugin = new UICheckBox( + i18nText("Fine-Design_Basic_Preference_Show-Template-Missing-Plugin")); + functionPane.add(showTemplateMissingPlugin); } private void createEditPane(JPanel generalPane) { @@ -644,6 +650,8 @@ public class PreferencePane extends BasicPane { supportDefaultParentCalculateCheckBox.setSelected(designerEnvManager.isSupportDefaultParentCalculate()); + showTemplateMissingPlugin.setSelected(designerEnvManager.isShowTemplateMissingPlugin()); + supportStringToFormulaBox.setSelected(designerEnvManager.isSupportStringToFormula()); shortCutLabel.setText(getDisplayShortCut(designerEnvManager.getAutoCompleteShortcuts())); @@ -744,6 +752,8 @@ public class PreferencePane extends BasicPane { designerEnvManager.setSupportDefaultParentCalculate(supportDefaultParentCalculateCheckBox.isSelected()); + designerEnvManager.setShowTemplateMissingPlugin(showTemplateMissingPlugin.isSelected()); + designerEnvManager.setSupportStringToFormula(supportStringToFormulaBox.isSelected()); designerEnvManager.setDefaultStringToFormula(defaultStringToFormulaBox.isSelected()); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/app/DesignerAppUtils.java b/designer-realize/src/main/java/com/fr/design/mainframe/app/DesignerAppUtils.java index 7fb16a56b..4680a8a25 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/app/DesignerAppUtils.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/app/DesignerAppUtils.java @@ -77,6 +77,11 @@ public class DesignerAppUtils { * @return 格式化后的多行插件错误信息详情 */ public static String dealWithErrorDetailMultiLineAndCache(String key) { + if (!DesignerEnvManager.getEnvManager().isShowTemplateMissingPlugin()) { + // 直接清空不提示 + TemplateIOErrorContextHolder.reset(); + return StringUtils.EMPTY; + } Multimap pendingPlugins = TemplateIOErrorContextHolder.getPendingPlugin(); if (pendingPlugins.isEmpty()) { return StringUtils.EMPTY;