|
|
@ -2,7 +2,9 @@ package com.fr.design.extra.exe.callback; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.general.FRLogger; |
|
|
|
import com.fr.general.FRLogger; |
|
|
|
import com.fr.general.Inter; |
|
|
|
import com.fr.general.Inter; |
|
|
|
import com.fr.plugin.manage.control.PluginTaskCallback; |
|
|
|
import com.fr.plugin.context.PluginMarker; |
|
|
|
|
|
|
|
import com.fr.plugin.error.PluginErrorCode; |
|
|
|
|
|
|
|
import com.fr.plugin.manage.PluginManager; |
|
|
|
import com.fr.plugin.manage.control.PluginTaskResult; |
|
|
|
import com.fr.plugin.manage.control.PluginTaskResult; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.*; |
|
|
|
import javax.swing.*; |
|
|
@ -10,11 +12,12 @@ import javax.swing.*; |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Created by ibm on 2017/5/27. |
|
|
|
* Created by ibm on 2017/5/27. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public class UninstallPluginCallback implements PluginTaskCallback { |
|
|
|
public class UninstallPluginCallback extends AbstractPluginTaskCallback { |
|
|
|
private JSCallback jsCallback; |
|
|
|
private JSCallback jsCallback; |
|
|
|
|
|
|
|
|
|
|
|
public UninstallPluginCallback(JSCallback jsCallback){ |
|
|
|
public UninstallPluginCallback(PluginMarker pluginMarker, JSCallback jsCallback){ |
|
|
|
this.jsCallback = jsCallback; |
|
|
|
this.jsCallback = jsCallback; |
|
|
|
|
|
|
|
this.pluginMarker = pluginMarker; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -23,6 +26,21 @@ public class UninstallPluginCallback implements PluginTaskCallback { |
|
|
|
jsCallback.execute("success"); |
|
|
|
jsCallback.execute("success"); |
|
|
|
FRLogger.getLogger().info(Inter.getLocText("FR-Designer-Plugin_Delete_Success")); |
|
|
|
FRLogger.getLogger().info(Inter.getLocText("FR-Designer-Plugin_Delete_Success")); |
|
|
|
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer-Plugin_Install_Successful")); |
|
|
|
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer-Plugin_Install_Successful")); |
|
|
|
|
|
|
|
}else if (result.errorCode() == PluginErrorCode.NeedInstallInterPluginDependency) { |
|
|
|
|
|
|
|
int rv = JOptionPane.showOptionDialog( |
|
|
|
|
|
|
|
null, |
|
|
|
|
|
|
|
Inter.getLocText(Inter.getLocText("FR-Designer-Plugin_Delete_Dependence")), |
|
|
|
|
|
|
|
Inter.getLocText("FR-Designer-Plugin_Delete_Success"), |
|
|
|
|
|
|
|
JOptionPane.YES_NO_CANCEL_OPTION, |
|
|
|
|
|
|
|
JOptionPane.INFORMATION_MESSAGE, |
|
|
|
|
|
|
|
null, |
|
|
|
|
|
|
|
null, |
|
|
|
|
|
|
|
null |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
if (rv == JOptionPane.CANCEL_OPTION || rv == JOptionPane.CLOSED_OPTION) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
PluginManager.getController().uninstall(pluginMarker, true, new UninstallPluginCallback(pluginMarker, jsCallback)); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
FRLogger.getLogger().info(Inter.getLocText("FR-Designer-Plugin_Delete_Failed")); |
|
|
|
FRLogger.getLogger().info(Inter.getLocText("FR-Designer-Plugin_Delete_Failed")); |
|
|
|
JOptionPane.showMessageDialog(null, result.getMessage(), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE); |
|
|
|
JOptionPane.showMessageDialog(null, result.getMessage(), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE); |
|
|
|