From 9b9fd7a297748f88e4547dd85b06a3ebda411d11 Mon Sep 17 00:00:00 2001 From: lucian Date: Mon, 21 Dec 2020 17:57:16 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-43744=20=E3=80=9010.0.13=E3=80=91?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E4=B8=8Ejar=E5=8C=85=E4=B8=8D=E5=8C=B9?= =?UTF-8?q?=E9=85=8D=E9=97=AE=E9=A2=98=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exe/callback/InstallFromDiskCallback.java | 19 +++++++++---------- .../exe/callback/InstallOnlineCallback.java | 12 +++++------- .../exe/callback/UninstallPluginCallback.java | 12 +++++------- .../exe/callback/UpdateFromDiskCallback.java | 19 +++++++++---------- .../exe/callback/UpdateOnlineCallback.java | 4 +--- 5 files changed, 29 insertions(+), 37 deletions(-) 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 14a6de942..81e76fa45 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 @@ -12,7 +12,6 @@ import com.fr.plugin.manage.PluginManager; import com.fr.plugin.manage.control.PluginTask; import com.fr.plugin.manage.control.PluginTaskResult; -import javax.swing.JOptionPane; import java.io.File; import java.util.List; @@ -45,17 +44,17 @@ public class InstallFromDiskCallback extends AbstractPluginTaskCallback { FineLoggerFactory.getLogger().info(successInfo); FineJOptionPane.showMessageDialog(null, successInfo); } else if (result.errorCode() == PluginErrorCode.NeedDealWithPluginDependency) { - int rv = JOptionPane.showOptionDialog( + int rv = FineJOptionPane.showOptionDialog( null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Dependence"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), - JOptionPane.YES_NO_CANCEL_OPTION, - JOptionPane.INFORMATION_MESSAGE, + FineJOptionPane.YES_NO_CANCEL_OPTION, + FineJOptionPane.INFORMATION_MESSAGE, null, FineJOptionPane.OPTION_YES_NO_CANCEL, null ); - if (rv == JOptionPane.NO_OPTION || rv == JOptionPane.CANCEL_OPTION || rv == JOptionPane.CLOSED_OPTION) { + if (rv == FineJOptionPane.NO_OPTION || rv == FineJOptionPane.CANCEL_OPTION || rv == FineJOptionPane.CLOSED_OPTION) { return; } List pluginTasks = result.getPreTasks(); @@ -65,24 +64,24 @@ public class InstallFromDiskCallback extends AbstractPluginTaskCallback { } PluginManager.getController().install(zipFile, new InstallFromDiskCallback(zipFile, jsCallback)); } else if(result.errorCode() == PluginErrorCode.HasLowerPluginWhenInstall){ - int rv = JOptionPane.showOptionDialog( + int rv = FineJOptionPane.showOptionDialog( null, Toolkit.i18nText("Fine-Design_Basic_Plugin_Has_Install_Lower"), Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), - JOptionPane.YES_NO_CANCEL_OPTION, - JOptionPane.INFORMATION_MESSAGE, + FineJOptionPane.YES_NO_CANCEL_OPTION, + FineJOptionPane.INFORMATION_MESSAGE, null, FineJOptionPane.OPTION_YES_NO_CANCEL, null ); - if (rv == JOptionPane.NO_OPTION || rv == JOptionPane.CANCEL_OPTION || rv == JOptionPane.CLOSED_OPTION) { + if (rv == FineJOptionPane.NO_OPTION || rv == FineJOptionPane.CANCEL_OPTION || rv == FineJOptionPane.CLOSED_OPTION) { return; } PluginOperateUtils.updatePluginFromDisk(zipFile, jsCallback); }else { jsCallback.execute("failed"); FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Failed")); - FineJOptionPane.showMessageDialog(null, pluginInfo, Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), JOptionPane.ERROR_MESSAGE); + FineJOptionPane.showMessageDialog(null, pluginInfo, Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), FineJOptionPane.ERROR_MESSAGE); } } } 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 0fd43c43b..c7059f50d 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 @@ -12,8 +12,6 @@ import com.fr.plugin.manage.control.AbstractDealPreTaskCallback; import com.fr.plugin.manage.control.PluginTask; import com.fr.plugin.manage.control.PluginTaskResult; -import javax.swing.JOptionPane; - /** * Created by ibm on 2017/5/26. @@ -43,17 +41,17 @@ public class InstallOnlineCallback extends AbstractDealPreTaskCallback { FineLoggerFactory.getLogger().info(successInfo); FineJOptionPane.showMessageDialog(null, successInfo); } else if(result.errorCode() == PluginErrorCode.HasLowerPluginWhenInstall){ - int rv = JOptionPane.showOptionDialog( + int rv = FineJOptionPane.showOptionDialog( null, Toolkit.i18nText("Fine-Design_Basic_Plugin_Has_Install_Lower"), Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), - JOptionPane.YES_NO_CANCEL_OPTION, - JOptionPane.INFORMATION_MESSAGE, + FineJOptionPane.YES_NO_CANCEL_OPTION, + FineJOptionPane.INFORMATION_MESSAGE, null, FineJOptionPane.OPTION_YES_NO_CANCEL, null ); - if (rv == JOptionPane.NO_OPTION || rv == JOptionPane.CANCEL_OPTION || rv == JOptionPane.CLOSED_OPTION) { + if (rv == FineJOptionPane.NO_OPTION || rv == FineJOptionPane.CANCEL_OPTION || rv == FineJOptionPane.CLOSED_OPTION) { jsCallback.execute("success"); return; } @@ -62,7 +60,7 @@ public class InstallOnlineCallback extends AbstractDealPreTaskCallback { } else { jsCallback.execute("failed"); FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Failed")); - FineJOptionPane.showMessageDialog(null, pluginInfo, Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), JOptionPane.ERROR_MESSAGE); + FineJOptionPane.showMessageDialog(null, pluginInfo, Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), FineJOptionPane.ERROR_MESSAGE); } } diff --git a/designer-base/src/main/java/com/fr/design/extra/exe/callback/UninstallPluginCallback.java b/designer-base/src/main/java/com/fr/design/extra/exe/callback/UninstallPluginCallback.java index bfa921125..df3839427 100644 --- a/designer-base/src/main/java/com/fr/design/extra/exe/callback/UninstallPluginCallback.java +++ b/designer-base/src/main/java/com/fr/design/extra/exe/callback/UninstallPluginCallback.java @@ -11,8 +11,6 @@ import com.fr.plugin.error.PluginErrorCode; import com.fr.plugin.manage.PluginManager; import com.fr.plugin.manage.control.PluginTaskResult; -import javax.swing.JOptionPane; - /** * Created by ibm on 2017/5/27. */ @@ -33,24 +31,24 @@ public class UninstallPluginCallback extends AbstractPluginTaskCallback { FineLoggerFactory.getLogger().info(successInfo); FineJOptionPane.showMessageDialog(null, successInfo); }else if (result.errorCode() == PluginErrorCode.NeedUninstallDependingPluginFirst) { - int rv = JOptionPane.showOptionDialog( + int rv = FineJOptionPane.showOptionDialog( null, Toolkit.i18nText("Fine-Design_Basic_Plugin_Delete_Dependence"), Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), - JOptionPane.YES_NO_CANCEL_OPTION, - JOptionPane.INFORMATION_MESSAGE, + FineJOptionPane.YES_NO_CANCEL_OPTION, + FineJOptionPane.INFORMATION_MESSAGE, null, FineJOptionPane.OPTION_YES_NO_CANCEL, null ); - if (rv == JOptionPane.CANCEL_OPTION || rv == JOptionPane.CLOSED_OPTION) { + if (rv == FineJOptionPane.CANCEL_OPTION || rv == FineJOptionPane.CLOSED_OPTION) { return; } PluginManager.getController().uninstall(pluginMarker, true, new UninstallPluginCallback(pluginMarker, jsCallback)); } else { jsCallback.execute("failed"); FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Plugin_Delete_Failed")); - FineJOptionPane.showMessageDialog(null, pluginInfo, Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), JOptionPane.ERROR_MESSAGE); + FineJOptionPane.showMessageDialog(null, pluginInfo, Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), FineJOptionPane.ERROR_MESSAGE); } } } diff --git a/designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java b/designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java index 551d94488..e5396d35c 100644 --- a/designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java +++ b/designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java @@ -12,7 +12,6 @@ import com.fr.plugin.manage.PluginManager; import com.fr.plugin.manage.control.PluginTask; import com.fr.plugin.manage.control.PluginTaskResult; -import javax.swing.JOptionPane; import java.io.File; import java.util.List; @@ -44,17 +43,17 @@ public class UpdateFromDiskCallback extends AbstractPluginTaskCallback { FineLoggerFactory.getLogger().info(successInfo); FineJOptionPane.showMessageDialog(null, successInfo); } else if (result.errorCode() == PluginErrorCode.NeedDealWithPluginDependency) { - int rv = JOptionPane.showOptionDialog( + int rv = FineJOptionPane.showOptionDialog( null, Toolkit.i18nText("Fine-Design_Basic_Plugin_Update_Dependence"), Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), - JOptionPane.YES_NO_CANCEL_OPTION, - JOptionPane.INFORMATION_MESSAGE, + FineJOptionPane.YES_NO_CANCEL_OPTION, + FineJOptionPane.INFORMATION_MESSAGE, null, FineJOptionPane.OPTION_YES_NO_CANCEL, null ); - if (rv == JOptionPane.NO_OPTION || rv == JOptionPane.CANCEL_OPTION || rv == JOptionPane.CLOSED_OPTION) { + if (rv == FineJOptionPane.NO_OPTION || rv == FineJOptionPane.CANCEL_OPTION || rv == FineJOptionPane.CLOSED_OPTION) { return; } List pluginTasks = result.getPreTasks(); @@ -64,24 +63,24 @@ public class UpdateFromDiskCallback extends AbstractPluginTaskCallback { } PluginManager.getController().update(zipFile, new UpdateFromDiskCallback(zipFile, jsCallback)); } else if(result.errorCode() == PluginErrorCode.NoPluginToUpdate){ - int rv = JOptionPane.showOptionDialog( + int rv = FineJOptionPane.showOptionDialog( null, Toolkit.i18nText("Fine-Design_Basic_Plugin_No_Plugin_Update"), Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), - JOptionPane.YES_NO_CANCEL_OPTION, - JOptionPane.INFORMATION_MESSAGE, + FineJOptionPane.YES_NO_CANCEL_OPTION, + FineJOptionPane.INFORMATION_MESSAGE, null, FineJOptionPane.OPTION_YES_NO_CANCEL, null ); - if (rv == JOptionPane.NO_OPTION || rv == JOptionPane.CANCEL_OPTION || rv == JOptionPane.CLOSED_OPTION) { + if (rv == FineJOptionPane.NO_OPTION || rv == FineJOptionPane.CANCEL_OPTION || rv == FineJOptionPane.CLOSED_OPTION) { return; } PluginOperateUtils.installPluginFromDisk(zipFile, jsCallback); }else { jsCallback.execute("failed"); FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Plugin_Update_Failed")); - FineJOptionPane.showMessageDialog(null, pluginInfo, Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), JOptionPane.ERROR_MESSAGE); + FineJOptionPane.showMessageDialog(null, pluginInfo, Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), FineJOptionPane.ERROR_MESSAGE); } } } diff --git a/designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateOnlineCallback.java b/designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateOnlineCallback.java index deeed7497..8dbad6a54 100644 --- a/designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateOnlineCallback.java +++ b/designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateOnlineCallback.java @@ -10,8 +10,6 @@ import com.fr.plugin.manage.control.AbstractDealPreTaskCallback; import com.fr.plugin.manage.control.PluginTask; import com.fr.plugin.manage.control.PluginTaskResult; -import javax.swing.JOptionPane; - /** * Created by ibm on 2017/5/26. */ @@ -40,7 +38,7 @@ public class UpdateOnlineCallback extends AbstractDealPreTaskCallback { } else { jsCallback.execute("failed"); FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Plugin_Update_Failed")); - FineJOptionPane.showMessageDialog(null, pluginInfo, Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), JOptionPane.ERROR_MESSAGE); + FineJOptionPane.showMessageDialog(null, pluginInfo, Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), FineJOptionPane.ERROR_MESSAGE); } } }