Browse Source

report-2354 整合后台插件操作代码

master
kerry 8 years ago
parent
commit
363138e5fc
  1. 111
      designer_base/src/com/fr/design/extra/PluginOperateUtils.java
  2. 25
      designer_base/src/com/fr/design/extra/PluginWebBridge.java
  3. 21
      designer_base/src/com/fr/design/extra/exe/callback/AbstractPluginTaskCallback.java
  4. 34
      designer_base/src/com/fr/design/extra/exe/callback/DownloadCallback.java
  5. 52
      designer_base/src/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java
  6. 53
      designer_base/src/com/fr/design/extra/exe/callback/InstallOnlineCallback.java
  7. 29
      designer_base/src/com/fr/design/extra/exe/callback/JSCallback.java
  8. 28
      designer_base/src/com/fr/design/extra/exe/callback/ModifyStatusCallback.java
  9. 26
      designer_base/src/com/fr/design/extra/exe/callback/UnistallPluginCallback.java
  10. 53
      designer_base/src/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java
  11. 55
      designer_base/src/com/fr/design/extra/exe/callback/UpdateOnlineCallback.java
  12. 10
      designer_base/src/com/fr/design/extra/exe/extratask/ExtraPluginTask.java
  13. 25
      designer_base/src/com/fr/design/extra/exe/extratask/InstallPluginTask.java
  14. 28
      designer_base/src/com/fr/design/extra/exe/extratask/UpdatePluginTask.java

111
designer_base/src/com/fr/design/extra/PluginOperateUtils.java

@ -0,0 +1,111 @@
package com.fr.design.extra;
import com.fr.base.FRContext;
import com.fr.design.extra.exe.callback.*;
import com.fr.design.extra.exe.extratask.InstallPluginTask;
import com.fr.design.extra.exe.extratask.UpdatePluginTask;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
import com.fr.json.JSONObject;
import com.fr.plugin.context.PluginContext;
import com.fr.plugin.context.PluginMarker;
import com.fr.plugin.manage.PluginManager;
import com.fr.plugin.manage.bbs.BBSPluginLogin;
import com.fr.plugin.manage.control.PluginTaskCallback;
import com.fr.plugin.manage.control.PluginTaskResult;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
import javafx.scene.web.WebEngine;
import netscape.javascript.JSObject;
import sun.plugin2.main.server.Plugin;
import javax.swing.*;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
/**
* Created by ibm on 2017/5/26.
*/
public class PluginOperateUtils {
public static void installPluginOnline(final String pluginInfo, JSCallback jsCallback) {
//下载插件
if (!BBSPluginLogin.getInstance().hasLogin()) {
LoginCheckContext.fireLoginCheckListener();
}
PluginMarker pluginMarker = PluginUtils.createPluginMarker(pluginInfo);
if (BBSPluginLogin.getInstance().hasLogin()) {
PluginManager.getController().download(pluginMarker, new DownloadCallback(new InstallPluginTask(pluginMarker, jsCallback), jsCallback));
}
}
public static void installPluginFromDisk(final String filePath, JSCallback jsCallback) {
PluginManager.getController().install(new File(filePath), new InstallFromDiskCallback(new File(filePath), jsCallback));
}
public static void updatePluginOnline(JSObject pluginIDs, JSCallback jsCallback) {
String[] pluginInfos = jsObjectToStringArray(pluginIDs);
if (!(BBSPluginLogin.getInstance().hasLogin())) {
LoginCheckContext.fireLoginCheckListener();
}
if (BBSPluginLogin.getInstance().hasLogin()) {
List<PluginMarker> pluginMarkerList = new ArrayList<PluginMarker>();
for (int i = 0; i < pluginInfos.length; i++) {
pluginMarkerList.add(PluginUtils.createPluginMarker(pluginInfos[i]));
}
for (int i = 0; i < pluginMarkerList.size(); i++) {
try {
//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_Connect_Failed"), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
return;
}
JSONObject resultArr = new JSONObject(latestPluginInfo);
String latestPluginVersion = (String) resultArr.get("version");
PluginMarker pluginMarker = pluginMarkerList.get(i);
PluginMarker toPluginMarker = PluginMarker.create(pluginMarkerList.get(i).getPluginID(), latestPluginVersion);
PluginManager.getController().download(pluginMarkerList.get(i), new DownloadCallback(new UpdatePluginTask(pluginMarker, toPluginMarker, jsCallback), jsCallback));
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
}
}
}
}
public static void updatePluginFromDisk(final String filePath, JSCallback jsCallback) {
PluginManager.getController().update(new File(filePath), new UpdateFromDiskCallback(new File(filePath), jsCallback));
}
public static void setPluginActive(String pluginInfo, JSCallback jsCallback) {
PluginMarker pluginMarker = PluginUtils.createPluginMarker(pluginInfo);
PluginContext plugin = PluginManager.getContext(pluginMarker);
boolean active = !plugin.isActive();
PluginTaskCallback modifyStatusCallback = new ModifyStatusCallback(active);
if (active) {
PluginManager.getController().forbid(pluginMarker, modifyStatusCallback);
} else {
PluginManager.getController().enable(pluginMarker, modifyStatusCallback);
}
}
public static void uninstallPlugin(final String pluginInfo, final boolean isForce, JSCallback jsCallback) {
PluginMarker pluginMarker = PluginUtils.createPluginMarker(pluginInfo);
PluginManager.getController().uninstall(pluginMarker, isForce, new UnistallPluginCallback());
}
private static String[] jsObjectToStringArray(JSObject obj) {
if (obj == null) {
return ArrayUtils.EMPTY_STRING_ARRAY;
}
int len = (int) obj.getMember("length");
List<String> list = new ArrayList<>();
for (int i = 0; i < len; i++) {
list.add(obj.getSlot(i).toString());
}
return list.toArray(new String[len]);
}
}

25
designer_base/src/com/fr/design/extra/PluginWebBridge.java

@ -5,6 +5,7 @@ import com.fr.design.DesignerEnvManager;
import com.fr.design.RestartHelper; import com.fr.design.RestartHelper;
import com.fr.design.dialog.UIDialog; import com.fr.design.dialog.UIDialog;
import com.fr.design.extra.exe.*; import com.fr.design.extra.exe.*;
import com.fr.design.extra.exe.callback.JSCallback;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.general.FRLogger; import com.fr.general.FRLogger;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -147,8 +148,8 @@ public class PluginWebBridge {
* @param callback 回调函数 * @param callback 回调函数
*/ */
public void installPluginOnline(final String pluginInfo, final JSObject callback) { public void installPluginOnline(final String pluginInfo, final JSObject callback) {
Task<Void> task = new PluginTask<>(webEngine, callback, new InstallOnlineExecutor(pluginInfo)); JSCallback jsCallback = new JSCallback(webEngine, callback);
new Thread(task).start(); PluginOperateUtils.installPluginOnline(pluginInfo,jsCallback);
} }
@ -159,8 +160,8 @@ public class PluginWebBridge {
* @param filePath 插件包的路径 * @param filePath 插件包的路径
*/ */
public void installPluginFromDisk(final String filePath, final JSObject callback) { public void installPluginFromDisk(final String filePath, final JSObject callback) {
Task<Void> task = new PluginTask<>(webEngine, callback, new InstallFromDiskExecutor(filePath)); JSCallback jsCallback = new JSCallback(webEngine, callback);
new Thread(task).start(); PluginOperateUtils.installPluginFromDisk(filePath,jsCallback);
} }
/** /**
@ -169,8 +170,8 @@ public class PluginWebBridge {
* @param pluginInfo 插件信息 * @param pluginInfo 插件信息
*/ */
public void uninstallPlugin(final String pluginInfo, final boolean isForce, final JSObject callback) { public void uninstallPlugin(final String pluginInfo, final boolean isForce, final JSObject callback) {
Task<Void> task = new PluginTask<>(webEngine, callback, new UninstallExecutor(pluginInfo, isForce)); JSCallback jsCallback = new JSCallback(webEngine, callback);
new Thread(task).start(); PluginOperateUtils.uninstallPlugin(pluginInfo, isForce, jsCallback);
} }
@ -180,8 +181,8 @@ public class PluginWebBridge {
* @param pluginIDs 插件集合 * @param pluginIDs 插件集合
*/ */
public void updatePluginOnline(JSObject pluginIDs, final JSObject callback) { public void updatePluginOnline(JSObject pluginIDs, final JSObject callback) {
Task<Void> task = new PluginTask<>(webEngine, callback, new UpdateOnlineExecutor(jsObjectToStringArray(pluginIDs))); JSCallback jsCallback = new JSCallback(webEngine, callback);
new Thread(task).start(); PluginOperateUtils.updatePluginOnline(pluginIDs, jsCallback);
} }
/** /**
@ -190,8 +191,8 @@ public class PluginWebBridge {
* @param filePath 插件包的路径 * @param filePath 插件包的路径
*/ */
public void updatePluginFromDisk(String filePath, final JSObject callback) { public void updatePluginFromDisk(String filePath, final JSObject callback) {
Task<Void> task = new PluginTask<>(webEngine, callback, new UpdateFromDiskExecutor(filePath)); JSCallback jsCallback = new JSCallback(webEngine, callback);
new Thread(task).start(); PluginOperateUtils.updatePluginFromDisk(filePath, jsCallback);
} }
/** /**
@ -200,8 +201,8 @@ public class PluginWebBridge {
* @param pluginID 插件ID * @param pluginID 插件ID
*/ */
public void setPluginActive(String pluginID, final JSObject callback) { public void setPluginActive(String pluginID, final JSObject callback) {
Task<Void> task = new PluginTask<>(webEngine, callback, new ModifyStatusExecutor(pluginID)); JSCallback jsCallback = new JSCallback(webEngine, callback);
new Thread(task).start(); PluginOperateUtils.setPluginActive(pluginID, jsCallback);
} }
/** /**

21
designer_base/src/com/fr/design/extra/exe/callback/AbstractPluginTaskCallback.java

@ -0,0 +1,21 @@
package com.fr.design.extra.exe.callback;
import com.fr.plugin.context.PluginMarker;
import com.fr.plugin.manage.control.ProgressCallback;
import java.io.File;
/**
* Created by ibm on 2017/5/26.
*/
public abstract class AbstractPluginTaskCallback implements ProgressCallback{
protected PluginMarker pluginMarker;
protected JSCallback jsCallback;
@Override
public void updateProgress(String description, double aProgress) {
}
}

34
designer_base/src/com/fr/design/extra/exe/callback/DownloadCallback.java

@ -0,0 +1,34 @@
package com.fr.design.extra.exe.callback;
import com.fr.design.extra.exe.extratask.ExtraPluginTask;
import com.fr.general.Inter;
import com.fr.plugin.manage.control.PluginTaskResult;
import com.fr.plugin.manage.control.ProgressCallback;
import javax.swing.*;
/**
* Created by ibm on 2017/5/26.
*/
public class DownloadCallback extends AbstractPluginTaskCallback {
private ExtraPluginTask extraPluginTask;
public DownloadCallback(ExtraPluginTask extraPluginTask, JSCallback jsCallback) {
this.extraPluginTask = extraPluginTask;
this.jsCallback = jsCallback;
}
@Override
public void updateProgress(String description, double aProgress) {
jsCallback.execute(String.valueOf(aProgress));
}
@Override
public void done(PluginTaskResult result) {
if (result.isSuccess()) {
extraPluginTask.doExtraPluginTask();
} else {
JOptionPane.showMessageDialog(null, result.getMessage(), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
}
}
}

52
designer_base/src/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java

@ -0,0 +1,52 @@
package com.fr.design.extra.exe.callback;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
import com.fr.plugin.manage.PluginManager;
import com.fr.plugin.manage.control.PluginTaskResult;
import javax.swing.*;
import java.io.File;
/**
* Created by ibm on 2017/5/26.
*/
public class InstallFromDiskCallback extends AbstractPluginTaskCallback{
private File zipFile;
public InstallFromDiskCallback(File zipFile, JSCallback jsCallback){
this.zipFile = zipFile;
this.jsCallback = jsCallback;
}
@Override
public void updateProgress(String description, double aProgress) {
jsCallback.execute(String.valueOf(aProgress));
}
@Override
public void done(PluginTaskResult result) {
if (result.isSuccess()) {
FRLogger.getLogger().info(Inter.getLocText("FR-Designer-Plugin_Install_Success"));
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer-Plugin_Install_Successful"));
} else if (result.errorCode() == 30) {
int rv = JOptionPane.showOptionDialog(
null,
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,
null,
null
);
if (rv == JOptionPane.CANCEL_OPTION || rv == JOptionPane.CLOSED_OPTION) {
return;
}
PluginManager.getController().install(zipFile, new InstallFromDiskCallback(zipFile, jsCallback));
// jsCallback.execute("installDependence");
} else {
JOptionPane.showMessageDialog(null, result.getMessage(), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
}
}
}

53
designer_base/src/com/fr/design/extra/exe/callback/InstallOnlineCallback.java

@ -0,0 +1,53 @@
package com.fr.design.extra.exe.callback;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
import com.fr.plugin.context.PluginMarker;
import com.fr.plugin.manage.PluginManager;
import com.fr.plugin.manage.control.PluginTaskResult;
import javax.swing.*;
/**
* Created by ibm on 2017/5/26.
*/
public class InstallOnlineCallback extends AbstractPluginTaskCallback {
public InstallOnlineCallback(PluginMarker pluginMarker, JSCallback jsCallback){
this.pluginMarker = pluginMarker;
this.jsCallback = jsCallback;
}
@Override
public void updateProgress(String description, double aProgress) {
jsCallback.execute(String.valueOf(aProgress));
}
@Override
public void done(PluginTaskResult result) {
if (result.isSuccess()) {
FRLogger.getLogger().info(Inter.getLocText("FR-Designer-Plugin_Install_Success"));
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer-Plugin_Install_Successful"));
} else if (result.errorCode() == 30) {
int rv = JOptionPane.showOptionDialog(
null,
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,
null,
null
);
if (rv == JOptionPane.CANCEL_OPTION || rv == JOptionPane.CLOSED_OPTION) {
return;
}
//执行JS回调
PluginManager.getController().install(pluginMarker, new InstallOnlineCallback(pluginMarker, jsCallback));
// jsCallback.execute("installDependence");
} else {
JOptionPane.showMessageDialog(null, result.getMessage(), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
}
}
}

29
designer_base/src/com/fr/design/extra/exe/callback/JSCallback.java

@ -0,0 +1,29 @@
package com.fr.design.extra.exe.callback;
import javafx.scene.web.WebEngine;
import netscape.javascript.JSObject;
/**
* Created by ibm on 2017/5/27.
*/
public class JSCallback {
private WebEngine webEngine;
private JSObject callback;
public JSCallback(final WebEngine webEngine, final JSObject callback) {
this.webEngine = webEngine;
this.callback = callback;
}
public void execute(String newValue) {
String fun = "(" + callback + ")(\"" + newValue + "\")";
try {
webEngine.executeScript(fun);
} catch (Exception e) {
webEngine.executeScript("alert(\"" + e.getMessage() + "\")");
}
}
}

28
designer_base/src/com/fr/design/extra/exe/callback/ModifyStatusCallback.java

@ -0,0 +1,28 @@
package com.fr.design.extra.exe.callback;
import com.fr.general.Inter;
import com.fr.plugin.manage.control.PluginTaskCallback;
import com.fr.plugin.manage.control.PluginTaskResult;
import javax.swing.*;
/**
* Created by ibm on 2017/5/27.
*/
public class ModifyStatusCallback implements PluginTaskCallback{
private boolean isActive;
public ModifyStatusCallback (boolean isActive){
this.isActive = isActive;
}
@Override
public void done(PluginTaskResult result) {
if (result.isSuccess()) {
String modifyMessage = isActive ? Inter.getLocText("FR-Designer-Plugin_Has_Been_Actived") : Inter.getLocText("FR-Designer-Plugin_Has_Been_Disabled");
JOptionPane.showMessageDialog(null, modifyMessage);
} else {
JOptionPane.showMessageDialog(null, result.getMessage(), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
}
}
}

26
designer_base/src/com/fr/design/extra/exe/callback/UnistallPluginCallback.java

@ -0,0 +1,26 @@
package com.fr.design.extra.exe.callback;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
import com.fr.plugin.manage.control.PluginTaskCallback;
import com.fr.plugin.manage.control.PluginTaskResult;
import sun.plugin2.main.server.Plugin;
import javax.swing.*;
/**
* Created by ibm on 2017/5/27.
*/
public class UnistallPluginCallback implements PluginTaskCallback {
@Override
public void done(PluginTaskResult result) {
if (result.isSuccess()) {
FRLogger.getLogger().info(Inter.getLocText("FR-Designer-Plugin_Delete_Success"));
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer-Plugin_Install_Successful"));
} else {
FRLogger.getLogger().info(Inter.getLocText("FR-Designer-Plugin_Delete_Failed"));
JOptionPane.showMessageDialog(null, result.getMessage(), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
}
}
}

53
designer_base/src/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java

@ -0,0 +1,53 @@
package com.fr.design.extra.exe.callback;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
import com.fr.general.jsqlparser.expression.StringValue;
import com.fr.plugin.manage.PluginManager;
import com.fr.plugin.manage.control.PluginTaskResult;
import javax.swing.*;
import java.io.File;
/**
* Created by ibm on 2017/5/27.
*/
public class UpdateFromDiskCallback extends AbstractPluginTaskCallback {
private File zipFile;
public UpdateFromDiskCallback(File zipFile,JSCallback jsCallback) {
this.zipFile = zipFile;
this.jsCallback = jsCallback;
}
@Override
public void updateProgress(String description, double aProgress) {
jsCallback.execute(String.valueOf(aProgress));
}
@Override
public void done(PluginTaskResult result) {
if (result.isSuccess()) {
FRLogger.getLogger().info(Inter.getLocText("FR-Designer-Plugin_Install_Success"));
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer-Plugin_Install_Successful"));
} else if (result.errorCode() == 30) {
int rv = JOptionPane.showOptionDialog(
null,
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,
null,
null
);
if (rv == JOptionPane.CANCEL_OPTION || rv == JOptionPane.CLOSED_OPTION) {
return;
}
PluginManager.getController().update(zipFile, new UpdateFromDiskCallback(zipFile, jsCallback));
} else {
JOptionPane.showMessageDialog(null, result.getMessage(), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
}
}
}

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

@ -0,0 +1,55 @@
package com.fr.design.extra.exe.callback;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
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 javax.swing.*;
/**
* Created by ibm on 2017/5/26.
*/
public class UpdateOnlineCallback extends AbstractPluginTaskCallback {
public PluginMarker toPluginMarker;
public UpdateOnlineCallback(PluginMarker pluginMarker , PluginMarker toPluginMarker, JSCallback jsCallback) {
this.pluginMarker = pluginMarker;
this.toPluginMarker = toPluginMarker;
this.jsCallback = jsCallback;
}
@Override
public void updateProgress(String description, double aProgress) {
jsCallback.execute(String.valueOf(aProgress));
}
@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()) {
int rv = JOptionPane.showOptionDialog(
null,
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,
null,
null
);
if (rv == JOptionPane.CANCEL_OPTION || rv == JOptionPane.CLOSED_OPTION) {
return;
}
PluginManager.getController().update(pluginMarker, toPluginMarker, new UpdateOnlineCallback(pluginMarker, toPluginMarker, jsCallback));
} else {
FRLogger.getLogger().info("更新失败");
JOptionPane.showMessageDialog(null, result.getMessage(), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
}
}
}

10
designer_base/src/com/fr/design/extra/exe/extratask/ExtraPluginTask.java

@ -0,0 +1,10 @@
package com.fr.design.extra.exe.extratask;
/**
* Created by ibm on 2017/5/27.
*/
public interface ExtraPluginTask {
void doExtraPluginTask();
}

25
designer_base/src/com/fr/design/extra/exe/extratask/InstallPluginTask.java

@ -0,0 +1,25 @@
package com.fr.design.extra.exe.extratask;
import com.fr.design.extra.exe.callback.InstallOnlineCallback;
import com.fr.design.extra.exe.callback.JSCallback;
import com.fr.plugin.context.PluginMarker;
import com.fr.plugin.manage.PluginManager;
import javax.swing.*;
/**
* Created by ibm on 2017/5/27.
*/
public class InstallPluginTask implements ExtraPluginTask{
public PluginMarker pluginMarker;
public JSCallback jsCallback;
public InstallPluginTask(PluginMarker pluginMarker, JSCallback jsCallback){
this.pluginMarker = pluginMarker;
this.jsCallback = jsCallback;
}
@Override
public void doExtraPluginTask() {
PluginManager.getController().install(pluginMarker, new InstallOnlineCallback(pluginMarker, jsCallback));
}
}

28
designer_base/src/com/fr/design/extra/exe/extratask/UpdatePluginTask.java

@ -0,0 +1,28 @@
package com.fr.design.extra.exe.extratask;
import com.fr.design.extra.exe.callback.JSCallback;
import com.fr.design.extra.exe.callback.UpdateOnlineCallback;
import com.fr.form.ui.WaterMark;
import com.fr.plugin.context.PluginMarker;
import com.fr.plugin.manage.PluginManager;
/**
* Created by ibm on 2017/5/27.
*/
public class UpdatePluginTask implements ExtraPluginTask {
public PluginMarker pluginMarker;
public PluginMarker toPluginMarker;
public JSCallback jsCallback;
public UpdatePluginTask(PluginMarker pluginMarker, PluginMarker toPluginMarker, JSCallback jsCallback){
this.pluginMarker = pluginMarker;
this.toPluginMarker = toPluginMarker;
this.jsCallback = jsCallback;
}
@Override
public void doExtraPluginTask() {
PluginManager.getController().update(pluginMarker, toPluginMarker, new UpdateOnlineCallback(pluginMarker, toPluginMarker, jsCallback));
}
}
Loading…
Cancel
Save