Browse Source

REPORT-2354 插件整合,設計器端的國際化key忘了改過來了

master
kerry 8 years ago
parent
commit
0df5da0bd0
  1. 37
      designer_base/src/com/fr/design/extra/exe/callback/DownloadCallback.java
  2. 10
      designer_base/src/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java
  3. 8
      designer_base/src/com/fr/design/extra/exe/callback/InstallOnlineCallback.java
  4. 2
      designer_base/src/com/fr/design/extra/exe/callback/ModifyStatusCallback.java
  5. 8
      designer_base/src/com/fr/design/extra/exe/callback/UninstallPluginCallback.java
  6. 10
      designer_base/src/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java
  7. 10
      designer_base/src/com/fr/design/extra/exe/callback/UpdateOnlineCallback.java

37
designer_base/src/com/fr/design/extra/exe/callback/DownloadCallback.java

@ -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);
}
}
}

10
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);
}
}

8
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);
}
}

2
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);

8
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);
}
}

10
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);
}
}

10
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) {
if (result.isSuccess()) {
String pluginInfo = PluginOperateUtils.getSuccessInfo(result);
if (result.isSuccess()) {
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);
}
}
}

Loading…
Cancel
Save