From 3e6b0f874e3928d485c059ac61b8010a2fb30a99 Mon Sep 17 00:00:00 2001 From: yvan Date: Fri, 19 Nov 2021 09:57:10 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-62680=20=E6=8F=92=E4=BB=B6-=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E7=AE=A1=E7=90=86-=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E9=87=8C=E6=B2=A1=E6=9C=89=E9=80=82=E9=85=8D=E7=A6=81=E7=94=A8?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=20=E4=BB=A3=E7=A0=81=E8=B4=A8=E9=87=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/extra/PluginOperateUtils.java | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java b/designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java index 7f68cd8bf..7dd2097dc 100644 --- a/designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java +++ b/designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java @@ -26,6 +26,7 @@ import com.fr.plugin.manage.control.PluginTaskCallback; import com.fr.plugin.manage.control.PluginTaskResult; import com.fr.plugin.view.PluginView; import com.fr.plugin.xml.PluginElementName; +import com.fr.plugin.xml.PluginXmlElement; import com.fr.stable.StringUtils; import javax.swing.JOptionPane; @@ -101,15 +102,21 @@ public class PluginOperateUtils { boolean active = plugin.isActive(); PluginTaskCallback modifyStatusCallback = new ModifyStatusCallback(active, jsCallback); if (active) { - // 禁用前提示 - int rv = FineJOptionPane.showConfirmDialog( - null, - plugin.getXml().getElement(PluginElementName.ForbidReminder).getContent(), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), - JOptionPane.OK_CANCEL_OPTION, - JOptionPane.WARNING_MESSAGE - ); - if (rv == JOptionPane.OK_OPTION) { + PluginXmlElement forbidReminder = plugin.getXml().getElement(PluginElementName.ForbidReminder); + if (forbidReminder != null && forbidReminder.getContent() != null) { + // 禁用前提示 + int rv = FineJOptionPane.showConfirmDialog( + null, + forbidReminder.getContent(), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), + JOptionPane.OK_CANCEL_OPTION, + JOptionPane.WARNING_MESSAGE + ); + if (rv == JOptionPane.OK_OPTION) { + PluginManager.getController().forbid(pluginMarker, modifyStatusCallback); + } + } else { + // 正常禁用 PluginManager.getController().forbid(pluginMarker, modifyStatusCallback); } } else {