Browse Source

KERNEL-442 不能识别大小写,被迫改个名字

bugfix/10.0
richie 6 years ago
parent
commit
d2345cd070
  1. 2
      designer-base/src/main/java/com/fr/design/upm/UPMPane.java
  2. 8
      designer-base/src/main/java/com/fr/design/upm/UpmBridge.java
  3. 2
      designer-base/src/main/java/com/fr/design/upm/UpmFinder.java
  4. 63
      designer-base/src/main/java/com/fr/design/upm/UpmModernPane.java

2
designer-base/src/main/java/com/fr/design/upm/UPMPane.java

@ -50,7 +50,7 @@ public class UpmPane extends BasicPane {
window.asObject().setProperty("PluginHelper", UpmBridge.getBridge(event.getBrowser()));
}
}).build();
EventDispatcher.listen(DownloadEvent.FINISH, new Listener<String>() {
EventDispatcher.listen(DownloadEvent.SUCCESS, new Listener<String>() {
@Override
public void on(Event event, String param) {
modernUIPane.redirect(UpmFinder.getMainResourcePath());

8
designer-base/src/main/java/com/fr/design/upm/UpmJSBridge.java → designer-base/src/main/java/com/fr/design/upm/UpmBridge.java

@ -48,15 +48,15 @@ import java.util.concurrent.RunnableFuture;
* Created by richie on 2019-04-12
* 桥接Java和JavaScript的类
*/
public class UpmJSBridge {
public class UpmBridge {
public static UpmJSBridge getBridge(Browser browser) {
return new UpmJSBridge(browser);
public static UpmBridge getBridge(Browser browser) {
return new UpmBridge(browser);
}
private JSObject window;
private UpmJSBridge(Browser browser) {
private UpmBridge(Browser browser) {
this.window = browser.executeJavaScriptAndReturnValue("window").asObject();
}

2
designer-base/src/main/java/com/fr/design/upm/UpmFinder.java

@ -51,7 +51,7 @@ public class UpmFinder {
}
public static void showUPMDialog() {
UpmModernPane upmPane = new UpmModernPane();
UpmPane upmPane = new UpmPane();
if (dialog == null) {
dialog = new UpmDialog(DesignerContext.getDesignerFrame(), upmPane);
}

63
designer-base/src/main/java/com/fr/design/upm/UpmModernPane.java

@ -1,63 +0,0 @@
package com.fr.design.upm;
import com.fr.design.dialog.BasicPane;
import com.fr.design.ui.ModernUIPane;
import com.fr.design.upm.event.DownloadEvent;
import com.fr.event.Event;
import com.fr.event.EventDispatcher;
import com.fr.event.Listener;
import com.teamdev.jxbrowser.chromium.JSValue;
import com.teamdev.jxbrowser.chromium.events.ScriptContextAdapter;
import com.teamdev.jxbrowser.chromium.events.ScriptContextEvent;
import java.awt.*;
/**
* @author richie
* @version 10.0
* Created by richie on 2019-04-12
* Update Plugin Manager容器
*/
public class UpmModernPane extends BasicPane {
private ModernUIPane<Object> modernUIPane;
@Override
protected String title4PopupWindow() {
return "UPM";
}
public UpmModernPane() {
setLayout(new BorderLayout());
if (UpmFinder.checkUPMResourcesExist()) {
modernUIPane = new ModernUIPane.Builder<>()
.prepare(new ScriptContextAdapter() {
@Override
public void onScriptContextCreated(ScriptContextEvent event) {
JSValue window = event.getBrowser().executeJavaScriptAndReturnValue("window");
window.asObject().setProperty("PluginHelper", UpmJSBridge.getBridge(event.getBrowser()));
}
})
.withURL(UpmFinder.getMainResourcePath())
.build();
} else {
modernUIPane = new ModernUIPane.Builder<>()
.withComponent(WarnComponent.KEY)
.prepare(new ScriptContextAdapter() {
@Override
public void onScriptContextCreated(ScriptContextEvent event) {
JSValue window = event.getBrowser().executeJavaScriptAndReturnValue("window");
window.asObject().setProperty("PluginHelper", UpmJSBridge.getBridge(event.getBrowser()));
}
}).build();
EventDispatcher.listen(DownloadEvent.SUCCESS, new Listener<String>() {
@Override
public void on(Event event, String param) {
modernUIPane.redirect(UpmFinder.getMainResourcePath());
}
});
}
add(modernUIPane, BorderLayout.CENTER);
}
}
Loading…
Cancel
Save