Browse Source

完善一下API

bugfix/10.0
richie 6 years ago
parent
commit
8634f6fa56
  1. 9
      designer-base/src/main/java/com/fr/design/upm/UpmBridge.java
  2. 2
      designer-base/src/main/resources/com/fr/design/upm/warn.js

9
designer-base/src/main/java/com/fr/design/upm/UpmBridge.java

@ -62,6 +62,11 @@ public class UpmBridge {
this.window = browser.executeJavaScriptAndReturnValue("window").asObject();
}
/**
* 下载并安装插件管理中心的资源文件
* @param callback 安装完成后的回调函数
*/
@JSBridge
public void startDownload(final JSFunction callback) {
new SwingWorker<Void, Void>(){
@ -77,10 +82,10 @@ public class UpmBridge {
protected void done() {
try {
get();
callback.invoke(window, Toolkit.i18nText("Fine-Design_Basic_Update_Plugin_Manager_Download_Success"));
callback.invoke(window, "success", Toolkit.i18nText("Fine-Design_Basic_Update_Plugin_Manager_Download_Success"));
EventDispatcher.fire(DownloadEvent.SUCCESS, "success");
} catch (Exception e) {
callback.invoke(window, Toolkit.i18nText("Fine-Design_Basic_Update_Plugin_Manager_Download_Error"));
callback.invoke(window, "error", Toolkit.i18nText("Fine-Design_Basic_Update_Plugin_Manager_Download_Error"));
FineLoggerFactory.getLogger().error(e.getMessage(), e);
EventDispatcher.fire(DownloadEvent.ERROR, "error");
}

2
designer-base/src/main/resources/com/fr/design/upm/warn.js

@ -4,7 +4,7 @@ window.onload = function () {
text: PluginHelper.i18nText("Fine-Design_Basic_Update_Plugin_Manager_Resource_Warn"),
height: 30
});
let callback = function(text) {
let callback = function(status, text) {
download.setValue(text);
};
let buttonOK = BI.createWidget({

Loading…
Cancel
Save