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