Browse Source

Merge pull request #3507 in DESIGN/design from feature/10.0 to feature/x

* commit 'eae8b639b976f05fd5de0f4fd734ac8fcb5813e1':
  REPORT-47193 插件管理提示弹窗优化
  REPORT-47193 插件管理提示弹窗优化
research/11.0
superman 4 years ago
parent
commit
81f43d92db
  1. 32
      designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java
  2. 18
      designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallOnlineCallback.java
  3. 14
      designer-base/src/main/java/com/fr/design/extra/exe/callback/UninstallPluginCallback.java
  4. 28
      designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java

32
designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java

@ -44,40 +44,32 @@ public class InstallFromDiskCallback extends AbstractPluginTaskCallback {
FineLoggerFactory.getLogger().info(successInfo); FineLoggerFactory.getLogger().info(successInfo);
FineJOptionPane.showMessageDialog(null, successInfo); FineJOptionPane.showMessageDialog(null, successInfo);
} else if (result.errorCode() == PluginErrorCode.NeedDealWithPluginDependency) { } else if (result.errorCode() == PluginErrorCode.NeedDealWithPluginDependency) {
int rv = FineJOptionPane.showOptionDialog( int rv = FineJOptionPane.showConfirmDialog(
null, null,
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Dependence"), Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Dependence"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"),
FineJOptionPane.YES_NO_CANCEL_OPTION, FineJOptionPane.OK_CANCEL_OPTION,
FineJOptionPane.INFORMATION_MESSAGE, FineJOptionPane.INFORMATION_MESSAGE
null,
FineJOptionPane.OPTION_YES_NO_CANCEL,
null
); );
if (rv == FineJOptionPane.NO_OPTION || rv == FineJOptionPane.CANCEL_OPTION || rv == FineJOptionPane.CLOSED_OPTION) { if (rv == FineJOptionPane.OK_OPTION) {
return;
}
List<PluginTask> pluginTasks = result.getPreTasks(); List<PluginTask> pluginTasks = result.getPreTasks();
for(PluginTask pluginTask : pluginTasks){ for(PluginTask pluginTask : pluginTasks){
PluginMarker marker = pluginTask.getMarker(); PluginMarker marker = pluginTask.getMarker();
PluginOperateUtils.installPluginOnline(marker, jsCallback); PluginOperateUtils.installPluginOnline(marker, jsCallback);
} }
PluginManager.getController().install(zipFile, new InstallFromDiskCallback(zipFile, jsCallback)); PluginManager.getController().install(zipFile, new InstallFromDiskCallback(zipFile, jsCallback));
}
} else if(result.errorCode() == PluginErrorCode.HasLowerPluginWhenInstall){ } else if(result.errorCode() == PluginErrorCode.HasLowerPluginWhenInstall){
int rv = FineJOptionPane.showOptionDialog( int rv = FineJOptionPane.showConfirmDialog(
null, null,
Toolkit.i18nText("Fine-Design_Basic_Plugin_Has_Install_Lower"), Toolkit.i18nText("Fine-Design_Basic_Plugin_Has_Install_Lower"),
Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"),
FineJOptionPane.YES_NO_CANCEL_OPTION, FineJOptionPane.OK_CANCEL_OPTION,
FineJOptionPane.INFORMATION_MESSAGE, FineJOptionPane.INFORMATION_MESSAGE
null,
FineJOptionPane.OPTION_YES_NO_CANCEL,
null
); );
if (rv == FineJOptionPane.NO_OPTION || rv == FineJOptionPane.CANCEL_OPTION || rv == FineJOptionPane.CLOSED_OPTION) { if (rv == FineJOptionPane.OK_OPTION) {
return;
}
PluginOperateUtils.updatePluginFromDisk(zipFile, jsCallback); PluginOperateUtils.updatePluginFromDisk(zipFile, jsCallback);
}
}else { }else {
jsCallback.execute("failed"); jsCallback.execute("failed");
FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Failed")); FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Failed"));

18
designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallOnlineCallback.java

@ -41,22 +41,20 @@ public class InstallOnlineCallback extends AbstractDealPreTaskCallback {
FineLoggerFactory.getLogger().info(successInfo); FineLoggerFactory.getLogger().info(successInfo);
FineJOptionPane.showMessageDialog(null, successInfo); FineJOptionPane.showMessageDialog(null, successInfo);
} else if(result.errorCode() == PluginErrorCode.HasLowerPluginWhenInstall){ } else if(result.errorCode() == PluginErrorCode.HasLowerPluginWhenInstall){
int rv = FineJOptionPane.showOptionDialog( int rv = FineJOptionPane.showConfirmDialog(
null, null,
Toolkit.i18nText("Fine-Design_Basic_Plugin_Has_Install_Lower"), Toolkit.i18nText("Fine-Design_Basic_Plugin_Has_Install_Lower"),
Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"),
FineJOptionPane.YES_NO_CANCEL_OPTION, FineJOptionPane.OK_CANCEL_OPTION,
FineJOptionPane.INFORMATION_MESSAGE, FineJOptionPane.INFORMATION_MESSAGE
null,
FineJOptionPane.OPTION_YES_NO_CANCEL,
null
); );
if (rv == FineJOptionPane.NO_OPTION || rv == FineJOptionPane.CANCEL_OPTION || rv == FineJOptionPane.CLOSED_OPTION) { if (rv == FineJOptionPane.OK_OPTION) {
jsCallback.execute("success");
return;
}
PluginMarker pluginMarker = result.getCurrentTask().getMarker(); PluginMarker pluginMarker = result.getCurrentTask().getMarker();
PluginOperateUtils.updatePluginOnline(pluginMarker, jsCallback); PluginOperateUtils.updatePluginOnline(pluginMarker, jsCallback);
}
else {
jsCallback.execute("success");
}
} else { } else {
jsCallback.execute("failed"); jsCallback.execute("failed");
FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Failed")); FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Failed"));

14
designer-base/src/main/java/com/fr/design/extra/exe/callback/UninstallPluginCallback.java

@ -31,20 +31,16 @@ public class UninstallPluginCallback extends AbstractPluginTaskCallback {
FineLoggerFactory.getLogger().info(successInfo); FineLoggerFactory.getLogger().info(successInfo);
FineJOptionPane.showMessageDialog(null, successInfo); FineJOptionPane.showMessageDialog(null, successInfo);
}else if (result.errorCode() == PluginErrorCode.NeedUninstallDependingPluginFirst) { }else if (result.errorCode() == PluginErrorCode.NeedUninstallDependingPluginFirst) {
int rv = FineJOptionPane.showOptionDialog( int rv = FineJOptionPane.showConfirmDialog(
null, null,
Toolkit.i18nText("Fine-Design_Basic_Plugin_Delete_Dependence"), Toolkit.i18nText("Fine-Design_Basic_Plugin_Delete_Dependence"),
Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"),
FineJOptionPane.YES_NO_CANCEL_OPTION, FineJOptionPane.OK_CANCEL_OPTION,
FineJOptionPane.INFORMATION_MESSAGE, FineJOptionPane.INFORMATION_MESSAGE
null,
FineJOptionPane.OPTION_YES_NO_CANCEL,
null
); );
if (rv == FineJOptionPane.CANCEL_OPTION || rv == FineJOptionPane.CLOSED_OPTION) { if (rv == FineJOptionPane.OK_OPTION) {
return;
}
PluginManager.getController().uninstall(pluginMarker, true, new UninstallPluginCallback(pluginMarker, jsCallback)); PluginManager.getController().uninstall(pluginMarker, true, new UninstallPluginCallback(pluginMarker, jsCallback));
}
} else { } else {
jsCallback.execute("failed"); jsCallback.execute("failed");
FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Plugin_Delete_Failed")); FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Plugin_Delete_Failed"));

28
designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java

@ -43,40 +43,32 @@ public class UpdateFromDiskCallback extends AbstractPluginTaskCallback {
FineLoggerFactory.getLogger().info(successInfo); FineLoggerFactory.getLogger().info(successInfo);
FineJOptionPane.showMessageDialog(null, successInfo); FineJOptionPane.showMessageDialog(null, successInfo);
} else if (result.errorCode() == PluginErrorCode.NeedDealWithPluginDependency) { } else if (result.errorCode() == PluginErrorCode.NeedDealWithPluginDependency) {
int rv = FineJOptionPane.showOptionDialog( int rv = FineJOptionPane.showConfirmDialog(
null, null,
Toolkit.i18nText("Fine-Design_Basic_Plugin_Update_Dependence"), Toolkit.i18nText("Fine-Design_Basic_Plugin_Update_Dependence"),
Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"),
FineJOptionPane.YES_NO_CANCEL_OPTION, FineJOptionPane.OK_CANCEL_OPTION,
FineJOptionPane.INFORMATION_MESSAGE, FineJOptionPane.INFORMATION_MESSAGE
null,
FineJOptionPane.OPTION_YES_NO_CANCEL,
null
); );
if (rv == FineJOptionPane.NO_OPTION || rv == FineJOptionPane.CANCEL_OPTION || rv == FineJOptionPane.CLOSED_OPTION) { if (rv == FineJOptionPane.OK_OPTION) {
return;
}
List<PluginTask> pluginTasks = result.getPreTasks(); List<PluginTask> pluginTasks = result.getPreTasks();
for(PluginTask pluginTask : pluginTasks){ for(PluginTask pluginTask : pluginTasks){
PluginMarker marker = pluginTask.getMarker(); PluginMarker marker = pluginTask.getMarker();
PluginOperateUtils.updatePluginOnline(marker, jsCallback); PluginOperateUtils.updatePluginOnline(marker, jsCallback);
} }
PluginManager.getController().update(zipFile, new UpdateFromDiskCallback(zipFile, jsCallback)); PluginManager.getController().update(zipFile, new UpdateFromDiskCallback(zipFile, jsCallback));
}
} else if(result.errorCode() == PluginErrorCode.NoPluginToUpdate){ } else if(result.errorCode() == PluginErrorCode.NoPluginToUpdate){
int rv = FineJOptionPane.showOptionDialog( int rv = FineJOptionPane.showConfirmDialog(
null, null,
Toolkit.i18nText("Fine-Design_Basic_Plugin_No_Plugin_Update"), Toolkit.i18nText("Fine-Design_Basic_Plugin_No_Plugin_Update"),
Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"),
FineJOptionPane.YES_NO_CANCEL_OPTION, FineJOptionPane.OK_CANCEL_OPTION,
FineJOptionPane.INFORMATION_MESSAGE, FineJOptionPane.INFORMATION_MESSAGE
null,
FineJOptionPane.OPTION_YES_NO_CANCEL,
null
); );
if (rv == FineJOptionPane.NO_OPTION || rv == FineJOptionPane.CANCEL_OPTION || rv == FineJOptionPane.CLOSED_OPTION) { if (rv == FineJOptionPane.OK_OPTION) {
return;
}
PluginOperateUtils.installPluginFromDisk(zipFile, jsCallback); PluginOperateUtils.installPluginFromDisk(zipFile, jsCallback);
}
}else { }else {
jsCallback.execute("failed"); jsCallback.execute("failed");
FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Plugin_Update_Failed")); FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Plugin_Update_Failed"));

Loading…
Cancel
Save