From 0df5da0bd0aa42fa3173b8237d248d087c564e5c Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 30 Jun 2017 14:51:35 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-2354=20=E6=8F=92=E4=BB=B6=E6=95=B4?= =?UTF-8?q?=E5=90=88=EF=BC=8C=E8=A8=AD=E8=A8=88=E5=99=A8=E7=AB=AF=E7=9A=84?= =?UTF-8?q?=E5=9C=8B=E9=9A=9B=E5=8C=96key=E5=BF=98=E4=BA=86=E6=94=B9?= =?UTF-8?q?=E9=81=8E=E4=BE=86=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extra/exe/callback/DownloadCallback.java | 37 ------------------- .../exe/callback/InstallFromDiskCallback.java | 10 ++--- .../exe/callback/InstallOnlineCallback.java | 8 ++-- .../exe/callback/ModifyStatusCallback.java | 2 +- .../exe/callback/UninstallPluginCallback.java | 8 ++-- .../exe/callback/UpdateFromDiskCallback.java | 10 ++--- .../exe/callback/UpdateOnlineCallback.java | 10 ++--- 7 files changed, 24 insertions(+), 61 deletions(-) delete mode 100644 designer_base/src/com/fr/design/extra/exe/callback/DownloadCallback.java diff --git a/designer_base/src/com/fr/design/extra/exe/callback/DownloadCallback.java b/designer_base/src/com/fr/design/extra/exe/callback/DownloadCallback.java deleted file mode 100644 index 117def482a..0000000000 --- a/designer_base/src/com/fr/design/extra/exe/callback/DownloadCallback.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.fr.design.extra.exe.callback; - -import com.fr.design.extra.PluginUtils; -import com.fr.design.extra.exe.extratask.ExtraPluginTask; -import com.fr.general.Inter; -import com.fr.plugin.manage.control.PluginTaskResult; - -import javax.swing.*; - -/** - * Created by ibm on 2017/5/26. - */ -public class DownloadCallback extends AbstractPluginTaskCallback { - private ExtraPluginTask extraPluginTask; - private JSCallback jsCallback; - private static int HUNDRED_PERCENT = 100; - - public DownloadCallback(final ExtraPluginTask extraPluginTask, final JSCallback jsCallback) { - this.extraPluginTask = extraPluginTask; - this.jsCallback = jsCallback; - } - - @Override - public void updateProgress(String description, double aProgress) { - jsCallback.execute(String.valueOf(aProgress * HUNDRED_PERCENT + "%")); - } - - @Override - public void done(PluginTaskResult result) { - if (result.isSuccess()) { - extraPluginTask.doExtraPluginTask(); - } else { - jsCallback.execute("failed"); - JOptionPane.showMessageDialog(null, PluginUtils.getMessageByErrorCode(result.errorCode()), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE); - } - } -} diff --git a/designer_base/src/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java b/designer_base/src/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java index 6d35eb7100..3311399fc5 100644 --- a/designer_base/src/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java +++ b/designer_base/src/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java @@ -37,12 +37,12 @@ public class InstallFromDiskCallback extends AbstractPluginTaskCallback { public void done(PluginTaskResult result) { if (result.isSuccess()) { jsCallback.execute("success"); - FRLogger.getLogger().info(Inter.getLocText("FR-Designer-Plugin_Install_Success")); - JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer-Plugin_Install_Success")); + FRLogger.getLogger().info(Inter.getLocText("FR-Plugin_Install_Success")); + JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Plugin_Install_Success")); } else if (result.errorCode() == PluginErrorCode.NeedDealWithPluginDependency) { int rv = JOptionPane.showOptionDialog( null, - Inter.getLocText(Inter.getLocText("FR-Designer-Plugin_Install_Dependence")), + Inter.getLocText(Inter.getLocText("FR-Plugin_Install_Dependence")), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE, @@ -62,7 +62,7 @@ public class InstallFromDiskCallback extends AbstractPluginTaskCallback { } else if(result.errorCode() == PluginErrorCode.HasLowerPluginWhenInstall){ int rv = JOptionPane.showOptionDialog( null, - Inter.getLocText("FR-Designer-Plugin_Has_Install_Lower"), + Inter.getLocText("FR-Plugin_Has_Install_Lower"), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE, @@ -76,7 +76,7 @@ public class InstallFromDiskCallback extends AbstractPluginTaskCallback { PluginOperateUtils.updatePluginOnline(pluginMarker, jsCallback); }else { jsCallback.execute("failed"); - FRLogger.getLogger().info(Inter.getLocText("FR-Designer-Plugin_Install_Failed")); + FRLogger.getLogger().info(Inter.getLocText("FR-Plugin_Install_Failed")); JOptionPane.showMessageDialog(null, PluginUtils.getMessageByErrorCode(result.errorCode()), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE); } } diff --git a/designer_base/src/com/fr/design/extra/exe/callback/InstallOnlineCallback.java b/designer_base/src/com/fr/design/extra/exe/callback/InstallOnlineCallback.java index 1e05d1269e..88f125a987 100644 --- a/designer_base/src/com/fr/design/extra/exe/callback/InstallOnlineCallback.java +++ b/designer_base/src/com/fr/design/extra/exe/callback/InstallOnlineCallback.java @@ -35,12 +35,12 @@ public class InstallOnlineCallback extends AbstractDealPreTaskCallback { String pluginInfo = PluginOperateUtils.getSuccessInfo(result); if (result.isSuccess()) { jsCallback.execute("success"); - FRLogger.getLogger().info(pluginInfo + Inter.getLocText("FR-Designer-Plugin_Install_Success")); - JOptionPane.showMessageDialog(null, pluginInfo + Inter.getLocText("FR-Designer-Plugin_Install_Success")); + FRLogger.getLogger().info(pluginInfo + Inter.getLocText("FR-Plugin_Install_Success")); + JOptionPane.showMessageDialog(null, pluginInfo + Inter.getLocText("FR-Plugin_Install_Success")); } else if(result.errorCode() == PluginErrorCode.HasLowerPluginWhenInstall){ int rv = JOptionPane.showOptionDialog( null, - Inter.getLocText("FR-Designer-Plugin_Has_Install_Lower"), + Inter.getLocText("FR-Plugin_Has_Install_Lower"), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE, @@ -55,7 +55,7 @@ public class InstallOnlineCallback extends AbstractDealPreTaskCallback { PluginOperateUtils.updatePluginOnline(pluginMarker, jsCallback); }else { jsCallback.execute("failed"); - FRLogger.getLogger().info(Inter.getLocText("FR-Designer-Plugin_Install_Failed")); + FRLogger.getLogger().info(Inter.getLocText("FR-Plugin_Install_Failed")); JOptionPane.showMessageDialog(null, pluginInfo, Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE); } } diff --git a/designer_base/src/com/fr/design/extra/exe/callback/ModifyStatusCallback.java b/designer_base/src/com/fr/design/extra/exe/callback/ModifyStatusCallback.java index d5b22c25f4..3f01f42e5b 100644 --- a/designer_base/src/com/fr/design/extra/exe/callback/ModifyStatusCallback.java +++ b/designer_base/src/com/fr/design/extra/exe/callback/ModifyStatusCallback.java @@ -22,7 +22,7 @@ public class ModifyStatusCallback implements PluginTaskCallback{ public void done(PluginTaskResult result) { if (result.isSuccess()) { jsCallback.execute("success"); - String modifyMessage = isActive ? Inter.getLocText("FR-Designer-Plugin_Disabled") : Inter.getLocText("FR-Designer-Plugin_Actived"); + String modifyMessage = isActive ? Inter.getLocText("FR-Plugin_Has_Been_Disabled") : Inter.getLocText("FR-Plugin_Has_Been_Actived"); JOptionPane.showMessageDialog(null, modifyMessage); } else { JOptionPane.showMessageDialog(null, PluginUtils.getMessageByErrorCode(result.errorCode()), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE); diff --git a/designer_base/src/com/fr/design/extra/exe/callback/UninstallPluginCallback.java b/designer_base/src/com/fr/design/extra/exe/callback/UninstallPluginCallback.java index 2ad36842b2..894903bff4 100644 --- a/designer_base/src/com/fr/design/extra/exe/callback/UninstallPluginCallback.java +++ b/designer_base/src/com/fr/design/extra/exe/callback/UninstallPluginCallback.java @@ -25,12 +25,12 @@ public class UninstallPluginCallback extends AbstractPluginTaskCallback { public void done(PluginTaskResult result) { if (result.isSuccess()) { jsCallback.execute("success"); - FRLogger.getLogger().info(Inter.getLocText("FR-Designer-Plugin_Delete_Success")); - JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer-Plugin_Delete_Success")); + FRLogger.getLogger().info(Inter.getLocText("FR-Plugin_Delete_Success")); + JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Plugin_Delete_Success")); }else if (result.errorCode() == PluginErrorCode.NeedUninstallDependingPluginFirst) { int rv = JOptionPane.showOptionDialog( null, - Inter.getLocText(Inter.getLocText("FR-Designer-Plugin_Delete_Dependence")), + Inter.getLocText(Inter.getLocText("FR-Plugin_Delete_Dependence")), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE, @@ -44,7 +44,7 @@ public class UninstallPluginCallback extends AbstractPluginTaskCallback { PluginManager.getController().uninstall(pluginMarker, true, new UninstallPluginCallback(pluginMarker, jsCallback)); } else { jsCallback.execute("failed"); - FRLogger.getLogger().info(Inter.getLocText("FR-Designer-Plugin_Delete_Failed")); + FRLogger.getLogger().info(Inter.getLocText("FR-Plugin_Delete_Failed")); JOptionPane.showMessageDialog(null, PluginUtils.getMessageByErrorCode(result.errorCode()), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE); } } diff --git a/designer_base/src/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java b/designer_base/src/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java index cbacc07f5d..89f5e1c057 100644 --- a/designer_base/src/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java +++ b/designer_base/src/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java @@ -37,12 +37,12 @@ public class UpdateFromDiskCallback extends AbstractPluginTaskCallback { public void done(PluginTaskResult result) { if (result.isSuccess()) { jsCallback.execute("success"); - FRLogger.getLogger().info(Inter.getLocText("FR-Designer-Plugin_Update_Success")); - JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer-Plugin_Update_Success")); + FRLogger.getLogger().info(Inter.getLocText("FR-Plugin_Update_Success")); + JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Plugin_Update_Success")); } else if (result.errorCode() == PluginErrorCode.NeedDealWithPluginDependency) { int rv = JOptionPane.showOptionDialog( null, - Inter.getLocText(Inter.getLocText("FR-Designer-Plugin_Update_Dependence")), + Inter.getLocText(Inter.getLocText("FR-Plugin_Update_Dependence")), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE, @@ -62,7 +62,7 @@ public class UpdateFromDiskCallback extends AbstractPluginTaskCallback { } else if(result.errorCode() == PluginErrorCode.NoPluginToUpdate){ int rv = JOptionPane.showOptionDialog( null, - Inter.getLocText("FR-Designer-Plugin_No_Plugin_Update"), + Inter.getLocText("FR-Plugin_No_Plugin_Update"), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE, @@ -76,7 +76,7 @@ public class UpdateFromDiskCallback extends AbstractPluginTaskCallback { PluginOperateUtils.installPluginFromDisk(zipFile, jsCallback); }else { jsCallback.execute("failed"); - FRLogger.getLogger().info(Inter.getLocText("FR-Designer-Plugin_Update_Failed")); + FRLogger.getLogger().info(Inter.getLocText("FR-Plugin_Update_Failed")); JOptionPane.showMessageDialog(null, PluginUtils.getMessageByErrorCode(result.errorCode()), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE); } } diff --git a/designer_base/src/com/fr/design/extra/exe/callback/UpdateOnlineCallback.java b/designer_base/src/com/fr/design/extra/exe/callback/UpdateOnlineCallback.java index dd3fcef2f7..441e27d95b 100644 --- a/designer_base/src/com/fr/design/extra/exe/callback/UpdateOnlineCallback.java +++ b/designer_base/src/com/fr/design/extra/exe/callback/UpdateOnlineCallback.java @@ -29,15 +29,15 @@ public class UpdateOnlineCallback extends AbstractDealPreTaskCallback { @Override public void allDone(PluginTaskResult result) { + String pluginInfo = PluginOperateUtils.getSuccessInfo(result); if (result.isSuccess()) { - String pluginInfo = PluginOperateUtils.getSuccessInfo(result); jsCallback.execute("success"); - FRLogger.getLogger().info(pluginInfo + Inter.getLocText("FR-Designer-Plugin_Update_Success")); - JOptionPane.showMessageDialog(null,pluginInfo + Inter.getLocText("FR-Designer-Plugin_Update_Success")); + FRLogger.getLogger().info(pluginInfo + Inter.getLocText("FR-Plugin_Update_Success")); + JOptionPane.showMessageDialog(null,pluginInfo + Inter.getLocText("FR-Plugin_Update_Success")); } else { jsCallback.execute("failed"); - FRLogger.getLogger().info(Inter.getLocText("FR-Designer-Plugin_Update_Failed")); - JOptionPane.showMessageDialog(null, PluginUtils.getMessageByErrorCode(result.errorCode()), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE); + FRLogger.getLogger().info(Inter.getLocText("FR-Plugin_Update_Failed")); + JOptionPane.showMessageDialog(null, pluginInfo, Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE); } } }