From 97d69685db84a000aeb8555a492ea3e1a5d36d0b Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 14 May 2021 16:55:47 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-49014=20=E8=BF=9E=E6=8E=A5=E5=90=8C?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E8=BF=9C=E7=A8=8B=E7=8E=AF=E5=A2=83=EF=BC=8C?= =?UTF-8?q?=E5=90=8C=E6=97=B6=E5=8F=8C=E5=87=BB=E6=89=93=E5=BC=80=E5=90=8C?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E6=A8=A1=E6=9D=BF=20=E4=B8=80=E4=BA=BA?= =?UTF-8?q?=E6=AD=A3=E5=B8=B8=E6=89=93=E5=BC=80=20=E4=B8=80=E4=BA=BA?= =?UTF-8?q?=E6=89=93=E5=BC=80=E7=A9=BA=E7=99=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/TemplateLockedHandler.java | 27 +++++++++++++++++++ .../com/fr/design/mainframe/app/CptApp.java | 2 ++ .../com/fr/design/mainframe/app/FormApp.java | 2 ++ .../com/fr/design/mainframe/app/XlsApp.java | 2 ++ .../com/fr/design/mainframe/app/XlsxApp.java | 2 ++ 5 files changed, 35 insertions(+) create mode 100644 designer-realize/src/main/java/com/fr/design/mainframe/TemplateLockedHandler.java diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/TemplateLockedHandler.java b/designer-realize/src/main/java/com/fr/design/mainframe/TemplateLockedHandler.java new file mode 100644 index 000000000..516cb4ceb --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/mainframe/TemplateLockedHandler.java @@ -0,0 +1,27 @@ +package com.fr.design.mainframe; + +import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.i18n.Toolkit; +import com.fr.design.ui.util.UIUtil; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/5/14 + */ +public class TemplateLockedHandler { + + public static void generateTipAndRefresh() { + UIUtil.invokeLaterIfNeeded(new Runnable() { + @Override + public void run() { + FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), + Toolkit.i18nText("Fine-Design_Basic_Template_Locked_Tip"), + Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), + FineJOptionPane.WARNING_MESSAGE); + DesignerFrameFileDealerPane.getInstance().refresh(); + } + }); + } + +} diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/app/CptApp.java b/designer-realize/src/main/java/com/fr/design/mainframe/app/CptApp.java index 4e9980a49..431b401fc 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/app/CptApp.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/app/CptApp.java @@ -13,6 +13,7 @@ import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DecodeDialog; +import com.fr.design.mainframe.TemplateLockedHandler; import com.fr.design.ui.util.UIUtil; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.exception.DecryptTemplateException; @@ -68,6 +69,7 @@ class CptApp extends AbstractWorkBookApp { FineLoggerFactory.getLogger().error(Toolkit.i18nText("Fine-Design_Basic_Template_Permission_Denied") + file, exp); } catch (TplLockedException exp) { FineLoggerFactory.getLogger().error(file + Toolkit.i18nText("Fine-Design_Basic_Template_Status_Locked"), exp); + TemplateLockedHandler.generateTipAndRefresh(); } catch (Exception exp) { FineLoggerFactory.getLogger().error(Toolkit.i18nText("Fine-Design_Report_NS_Exception_ReadError") + file, exp); } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java b/designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java index 02692c991..4100a03c8 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java @@ -10,6 +10,7 @@ import com.fr.design.mainframe.BaseJForm; import com.fr.design.mainframe.DecodeDialog; import com.fr.design.mainframe.JForm; import com.fr.design.mainframe.JTemplate; +import com.fr.design.mainframe.TemplateLockedHandler; import com.fr.design.worker.open.OpenResult; import com.fr.design.worker.open.OpenWorker; import com.fr.exception.DecryptTemplateException; @@ -106,6 +107,7 @@ class FormApp extends AbstractAppProvider { FineLoggerFactory.getLogger().error(Toolkit.i18nText("Fine-Design_Basic_Template_Permission_Denied") + file, exp); } catch (TplLockedException exp) { FineLoggerFactory.getLogger().error(file + Toolkit.i18nText("Fine-Design_Basic_Template_Status_Locked"), exp); + TemplateLockedHandler.generateTipAndRefresh(); } catch (Exception exp) { FineLoggerFactory.getLogger().error("Failed to generate frm from " + file, exp); return null; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/app/XlsApp.java b/designer-realize/src/main/java/com/fr/design/mainframe/app/XlsApp.java index 3741f8b35..5b135ccdf 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/app/XlsApp.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/app/XlsApp.java @@ -2,6 +2,7 @@ package com.fr.design.mainframe.app; import com.fr.base.extension.FileExtension; import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.TemplateLockedHandler; import com.fr.exception.RemoteDesignPermissionDeniedException; import com.fr.exception.TplLockedException; import com.fr.file.FILE; @@ -30,6 +31,7 @@ class XlsApp extends AbstractWorkBookApp { FineLoggerFactory.getLogger().error(Toolkit.i18nText("Fine-Design_Basic_Template_Permission_Denied") + tplFile, exp); } catch (TplLockedException exp) { FineLoggerFactory.getLogger().error(tplFile + Toolkit.i18nText("Fine-Design_Basic_Template_Status_Locked"), exp); + TemplateLockedHandler.generateTipAndRefresh(); } catch (Exception exp) { FineLoggerFactory.getLogger().error("Failed to generate xls from " + tplFile, exp); } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/app/XlsxApp.java b/designer-realize/src/main/java/com/fr/design/mainframe/app/XlsxApp.java index 9d66cffb8..f5a5498cf 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/app/XlsxApp.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/app/XlsxApp.java @@ -2,6 +2,7 @@ package com.fr.design.mainframe.app; import com.fr.base.extension.FileExtension; import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.TemplateLockedHandler; import com.fr.exception.RemoteDesignPermissionDeniedException; import com.fr.exception.TplLockedException; import com.fr.file.FILE; @@ -31,6 +32,7 @@ class XlsxApp extends AbstractWorkBookApp { FineLoggerFactory.getLogger().error(Toolkit.i18nText("Fine-Design_Basic_Template_Permission_Denied") + tplFile, exp); } catch (TplLockedException exp) { FineLoggerFactory.getLogger().error(tplFile + Toolkit.i18nText("Fine-Design_Basic_Template_Status_Locked"), exp); + TemplateLockedHandler.generateTipAndRefresh(); } catch (Exception exp) { FineLoggerFactory.getLogger().error("Failed to generate xlsx from " + tplFile, exp); } From 9cbe4baef8a20b47b5d3fc4c9422a856f18cc4f9 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 14 May 2021 18:21:33 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-49014=20update=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=B8=8B=E5=9B=BD=E9=99=85=E5=8C=96key?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/TemplateLockedHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/TemplateLockedHandler.java b/designer-realize/src/main/java/com/fr/design/mainframe/TemplateLockedHandler.java index 516cb4ceb..7eb6eec5c 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/TemplateLockedHandler.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/TemplateLockedHandler.java @@ -16,7 +16,7 @@ public class TemplateLockedHandler { @Override public void run() { FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), - Toolkit.i18nText("Fine-Design_Basic_Template_Locked_Tip"), + Toolkit.i18nText("Fine_Designer_Remote_Design_Locked_Message"), Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), FineJOptionPane.WARNING_MESSAGE); DesignerFrameFileDealerPane.getInstance().refresh();