From d5c31126decf371118dc61f590aed3439c042a3c Mon Sep 17 00:00:00 2001 From: Lanlan Date: Thu, 25 Jul 2019 11:28:10 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-18362=20=E6=8F=92=E4=BB=B6=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E6=A0=B9=E6=8D=AElic=E6=98=BE=E7=A4=BA-=E5=89=8D?= =?UTF-8?q?=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/extra/PluginOperateUtils.java | 16 ++++++++++++++++ .../exe/callback/InstallFromDiskCallback.java | 6 ++++-- .../exe/callback/InstallOnlineCallback.java | 5 +++-- 3 files changed, 23 insertions(+), 4 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 774578630..c7c503ff3 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 @@ -206,5 +206,21 @@ public class PluginOperateUtils { return pluginInfo.toString(); } + public static String getSwitchedInfo(PluginTaskResult result) { + StringBuilder pluginInfo = new StringBuilder(); + List pluginTaskResults = result.asList(); + for (PluginTaskResult pluginTaskResult : pluginTaskResults) { + PluginTask pluginTask = pluginTaskResult.getCurrentTask(); + if (pluginTask == null) { + continue; + } + PluginMarker pluginMarker = pluginTask.getToMarker(); + PluginContext pluginContext = PluginManager.getContext(pluginMarker); + if (pluginContext != null && pluginContext.getSelfState() == 1) { + pluginInfo.append("\n").append(pluginContext.getSwitchedReason()); + } + } + return pluginInfo.toString(); + } } diff --git a/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java b/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java index e8096efbf..59d5d6a08 100644 --- a/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java +++ b/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java @@ -36,10 +36,12 @@ public class InstallFromDiskCallback extends AbstractPluginTaskCallback { @Override public void done(PluginTaskResult result) { + String pluginInfo = PluginOperateUtils.getSuccessInfo(result); if (result.isSuccess()) { + String switchedInfo = PluginOperateUtils.getSwitchedInfo(result); jsCallback.execute("success"); - FineLoggerFactory.getLogger().info(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Success")); - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Success")); + FineLoggerFactory.getLogger().info(pluginInfo + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Success") + switchedInfo); + JOptionPane.showMessageDialog(null, pluginInfo + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Success") + switchedInfo); } else if (result.errorCode() == PluginErrorCode.NeedDealWithPluginDependency) { int rv = JOptionPane.showOptionDialog( null, diff --git a/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallOnlineCallback.java b/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallOnlineCallback.java index 23b6679b6..6e72c0478 100644 --- a/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallOnlineCallback.java +++ b/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallOnlineCallback.java @@ -35,9 +35,10 @@ public class InstallOnlineCallback extends AbstractDealPreTaskCallback { protected void allDone(PluginTaskResult result) { String pluginInfo = PluginOperateUtils.getSuccessInfo(result); if (result.isSuccess()) { + String switchedInfo = PluginOperateUtils.getSwitchedInfo(result); jsCallback.execute("success"); - FineLoggerFactory.getLogger().info(pluginInfo + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Success")); - JOptionPane.showMessageDialog(null, pluginInfo + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Success")); + FineLoggerFactory.getLogger().info(pluginInfo + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Success") + switchedInfo); + JOptionPane.showMessageDialog(null, pluginInfo + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Success") + switchedInfo); } else if(result.errorCode() == PluginErrorCode.HasLowerPluginWhenInstall){ int rv = JOptionPane.showOptionDialog( null,