Browse Source

REPORT-43744 【10.0.13】插件与jar包不匹配问题优化

feature/big-screen
lucian 4 years ago
parent
commit
9b9fd7a297
  1. 19
      designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java
  2. 12
      designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallOnlineCallback.java
  3. 12
      designer-base/src/main/java/com/fr/design/extra/exe/callback/UninstallPluginCallback.java
  4. 19
      designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java
  5. 4
      designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateOnlineCallback.java

19
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<PluginTask> 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);
}
}
}

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

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

19
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<PluginTask> 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);
}
}
}

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

Loading…
Cancel
Save