Browse Source

修改PMD

master
kerry 8 years ago
parent
commit
47138c4840
  1. 20
      designer_base/src/com/fr/design/extra/exe/InstallFromDiskExecutor.java
  2. 12
      designer_base/src/com/fr/design/extra/exe/InstallOnlineExecutor.java
  3. 4
      designer_base/src/com/fr/design/extra/exe/UninstallExecutor.java
  4. 5
      designer_base/src/com/fr/design/extra/exe/UpdateFromDiskExecutor.java
  5. 11
      designer_base/src/com/fr/design/extra/exe/UpdateOnlineExecutor.java
  6. 4
      designer_base/src/com/fr/design/extra/exe/callback/UpdateOnlineCallback.java

20
designer_base/src/com/fr/design/extra/exe/InstallFromDiskExecutor.java

@ -24,7 +24,7 @@ public class InstallFromDiskExecutor implements Executor {
@Override
public String getTaskFinishMessage() {
return "已成功安装";
return Inter.getLocText("FR-Designer-Plugin_Success_Install");
}
@Override
@ -33,7 +33,7 @@ public class InstallFromDiskExecutor implements Executor {
new Command() {
@Override
public String getExecuteMessage() {
return "正在解压文件" + filePath;
return Inter.getLocText("FR-Designer-Plugin_Unzipping") + filePath;
}
@Override
@ -44,7 +44,7 @@ public class InstallFromDiskExecutor implements Executor {
new Command() {
@Override
public String getExecuteMessage() {
return "正在安装";
return Inter.getLocText("FR-Designer-Plugin_Installing");
}
@Override
@ -56,11 +56,11 @@ public class InstallFromDiskExecutor implements Executor {
@Override
public void done(PluginTaskResult result) {
if (result.isSuccess()) {
FRLogger.getLogger().info("插件安装成功");
FRLogger.getLogger().info(Inter.getLocText("FR-Designer-Plugin_Install_Success"));
} else if(result.errorCode() == PluginErrorCode.OperationNotSupport.getCode()){
int rv = JOptionPane.showOptionDialog(
null,
Inter.getLocText("安装依赖"),
Inter.getLocText(Inter.getLocText("FR-Designer-Plugin_Install_Dependence")),
Inter.getLocText("FR-Designer-Plugin_Warning"),
JOptionPane.YES_NO_CANCEL_OPTION,
JOptionPane.INFORMATION_MESSAGE,
@ -71,9 +71,9 @@ public class InstallFromDiskExecutor implements Executor {
if (rv == JOptionPane.CANCEL_OPTION || rv == JOptionPane.CLOSED_OPTION) {
return;
}
installWithDepenndence();
installWithDependence();
}else{
FRLogger.getLogger().info("插件安装失败");
FRLogger.getLogger().info(Inter.getLocText("FR-Designer-Plugin_Install_Failed"));
JOptionPane.showMessageDialog(null, result.getMessage(), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
}
}
@ -83,7 +83,7 @@ public class InstallFromDiskExecutor implements Executor {
};
}
public void installWithDepenndence(){
public void installWithDependence(){
PluginManager.getController().install(new File(filePath), new ProgressCallback() {
@Override
public void updateProgress(String description, double progress) {
@ -91,10 +91,10 @@ public class InstallFromDiskExecutor implements Executor {
@Override
public void done(PluginTaskResult result) {
if (result.isSuccess()) {
FRLogger.getLogger().info("插件安装成功");
FRLogger.getLogger().info(Inter.getLocText("FR-Designer-Plugin_Install_Success"));
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer-Plugin_Install_Successful"));
} else{
FRLogger.getLogger().info("插件安装失败");
FRLogger.getLogger().info(Inter.getLocText("FR-Designer-Plugin_Install_Failed"));
JOptionPane.showMessageDialog(null, result.getMessage(), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
}
}

12
designer_base/src/com/fr/design/extra/exe/InstallOnlineExecutor.java

@ -36,7 +36,7 @@ public class InstallOnlineExecutor implements Executor {
new Command() {
@Override
public String getExecuteMessage() {
return "正在下载插件:" + pluginInfo.split("_")[0];
return Inter.getLocText("FR-Designer-Plugin_Downloading") + ":" + pluginInfo.split("_")[0];
}
@Override
@ -79,13 +79,13 @@ public class InstallOnlineExecutor implements Executor {
@Override
public void done(PluginTaskResult result) {
if (result.isSuccess()) {
FRLogger.getLogger().info("插件安装成功");
FRLogger.getLogger().info(Inter.getLocText("FR-Designer-Plugin_Install_Success"));
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer-Plugin_Install_Successful"));
} else if (result.errorCode() == PluginErrorCode.OperationNotSupport.getCode()) {
int rv = JOptionPane.showOptionDialog(
null,
Inter.getLocText("安装依赖"),
Inter.getLocText("FR-Designer-Plugin_Warning"),
Inter.getLocText(Inter.getLocText("FR-Designer-Plugin_Install_Success")),
Inter.getLocText("FR-Designer-Plugin_Install_Dependence"),
JOptionPane.YES_NO_CANCEL_OPTION,
JOptionPane.INFORMATION_MESSAGE,
null,
@ -112,10 +112,10 @@ public class InstallOnlineExecutor implements Executor {
@Override
public void done(PluginTaskResult result) {
if (result.isSuccess()) {
FRLogger.getLogger().info("插件安装成功");
FRLogger.getLogger().info(Inter.getLocText("FR-Designer-Plugin_Install_Success"));
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer-Plugin_Install_Successful"));
} else {
FRLogger.getLogger().info("插件安装失败");
FRLogger.getLogger().info(Inter.getLocText("FR-Designer-Plugin_Install_Failed"));
JOptionPane.showMessageDialog(null, result.getMessage(), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
}
}

4
designer_base/src/com/fr/design/extra/exe/UninstallExecutor.java

@ -47,10 +47,10 @@ public class UninstallExecutor implements Executor {
public void done(PluginTaskResult pluginTaskResult) {
if (pluginTaskResult.isSuccess()) {
result = "done";
FRLogger.getLogger().info("删除成功");
FRLogger.getLogger().info(Inter.getLocText("FR-Designer-Plugin_Delete_Success"));
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer-Plugin_Install_Successful"));
} else {
FRLogger.getLogger().info("删除失败");
FRLogger.getLogger().info(Inter.getLocText("FR-Designer-Plugin_Delete_Failed"));
JOptionPane.showMessageDialog(null, pluginTaskResult.getMessage(), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
}
}

5
designer_base/src/com/fr/design/extra/exe/UpdateFromDiskExecutor.java

@ -24,7 +24,7 @@ public class UpdateFromDiskExecutor implements Executor {
@Override
public String getTaskFinishMessage() {
return "插件更新操作结束";
return Inter.getLocText("FR-Designer-Plugin_Update_End");
}
@Override
@ -47,7 +47,7 @@ public class UpdateFromDiskExecutor implements Executor {
@Override
public void done(PluginTaskResult result) {
if (result.isSuccess()) {
FRLogger.getLogger().info("更新成功");
FRLogger.getLogger().info(Inter.getLocText("FR-Designer-Plugin_Update_Success"));
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer-Plugin_Install_Successful"));
} else if (result.errorCode() == PluginErrorCode.OperationNotSupport.getCode()) {
updatePluginWithDependence();
@ -71,7 +71,6 @@ public class UpdateFromDiskExecutor implements Executor {
@Override
public void done(PluginTaskResult result) {
if (result.isSuccess()) {
FRLogger.getLogger().info("更新成功");
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer-Plugin_Install_Successful"));
} else {
JOptionPane.showMessageDialog(null, result.getMessage(), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);

11
designer_base/src/com/fr/design/extra/exe/UpdateOnlineExecutor.java

@ -10,6 +10,7 @@ import com.fr.json.JSONObject;
import com.fr.plugin.context.PluginMarker;
import com.fr.plugin.error.PluginErrorCode;
import com.fr.plugin.manage.PluginManager;
import com.fr.plugin.manage.bbs.BBSPluginLogin;
import com.fr.plugin.manage.control.PluginTaskResult;
import com.fr.plugin.manage.control.ProgressCallback;
import com.fr.stable.StringUtils;
@ -46,10 +47,10 @@ public class UpdateOnlineExecutor implements Executor {
@Override
public void run(Process<String> process) {
if (StringUtils.isBlank(DesignerEnvManager.getEnvManager().getBBSName())) {
if (!(BBSPluginLogin.getInstance().hasLogin())){
LoginCheckContext.fireLoginCheckListener();
}
if (StringUtils.isNotBlank(DesignerEnvManager.getEnvManager().getBBSName())) {
if (BBSPluginLogin.getInstance().hasLogin()) {
List<PluginMarker> pluginMarkerList = new ArrayList<PluginMarker>();
for (int i = 0; i < pluginInfos.length; i++) {
pluginMarkerList.add(PluginUtils.createPluginMarker(pluginInfos[i]));
@ -70,10 +71,8 @@ public class UpdateOnlineExecutor implements Executor {
@Override
public void done(PluginTaskResult result) {
if (result.isSuccess()) {
FRLogger.getLogger().info("更新成功");
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer-Plugin_Install_Successful"));
} else {
FRLogger.getLogger().info("更新失败");
JOptionPane.showMessageDialog(null, result.getMessage(), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
}
}
@ -87,7 +86,7 @@ public class UpdateOnlineExecutor implements Executor {
//todo check下此插件的最新版本
String latestPluginInfo = PluginUtils.getLatestPluginInfo(pluginMarkerList.get(i).getPluginID());
if (StringUtils.isEmpty(latestPluginInfo) || PluginConstants.CONNECTION_404.equals(latestPluginInfo)) {
JOptionPane.showMessageDialog(null, "插件商城连接失败", Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer-Plugin_Connect_Failed"), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
return;
}
JSONObject resultArr = new JSONObject(latestPluginInfo);
@ -102,12 +101,10 @@ public class UpdateOnlineExecutor implements Executor {
@Override
public void done(PluginTaskResult result) {
if (result.isSuccess()) {
FRLogger.getLogger().info("更新成功");
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer-Plugin_Install_Successful"));
} else if (result.errorCode() == PluginErrorCode.OperationNotSupport.getCode()) {
updatePluginWithDependence(pluginMarkerList.get(a), PluginMarker.create(pluginMarkerList.get(a).getPluginID(), latestPluginVersion));
} else {
FRLogger.getLogger().info("更新失败");
JOptionPane.showMessageDialog(null, result.getMessage(), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
}
}

4
designer_base/src/com/fr/design/extra/exe/callback/UpdateOnlineCallback.java

@ -30,7 +30,7 @@ public class UpdateOnlineCallback extends AbstractPluginTaskCallback {
@Override
public void done(PluginTaskResult result) {
if (result.isSuccess()) {
FRLogger.getLogger().info("更新成功");
FRLogger.getLogger().info(Inter.getLocText("FR-Designer-Plugin_Update_Success"));
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer-Plugin_Install_Successful"));
} else if (result.errorCode() == PluginErrorCode.OperationNotSupport.getCode()) {
int rv = JOptionPane.showOptionDialog(
@ -48,7 +48,7 @@ public class UpdateOnlineCallback extends AbstractPluginTaskCallback {
}
PluginManager.getController().update(pluginMarker, toPluginMarker, new UpdateOnlineCallback(pluginMarker, toPluginMarker, jsCallback));
} else {
FRLogger.getLogger().info("更新失败");
FRLogger.getLogger().info(Inter.getLocText("FR-Designer-Plugin_Delete_Failed"));
JOptionPane.showMessageDialog(null, result.getMessage(), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
}
}

Loading…
Cancel
Save