From 5b836f0b8c5d8fbbe23011cfad82f3d97050b1d0 Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 11 Apr 2022 17:04:18 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-69324=20=E6=8F=92=E4=BB=B6-=E6=96=B0?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E7=AE=A1=E7=90=86-=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E5=86=85=E6=8F=92=E4=BB=B6=E7=AE=A1=E7=90=86=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=8F=B7=E6=98=BE=E7=A4=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/upm/UpmShowPane.java | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/upm/UpmShowPane.java b/designer-base/src/main/java/com/fr/design/upm/UpmShowPane.java index 0384b5c29..23a712508 100644 --- a/designer-base/src/main/java/com/fr/design/upm/UpmShowPane.java +++ b/designer-base/src/main/java/com/fr/design/upm/UpmShowPane.java @@ -32,23 +32,14 @@ public class UpmShowPane extends BasicPane { UpmShowPane() { setLayout(new BorderLayout()); - modernUIPane = ModernUIPaneFactory.modernUIPaneBuilder() - .prepareForV6(new ScriptContextAdapter() { + modernUIPane = new ModernUIPane.Builder<>() + .prepare(new ScriptContextAdapter() { @Override public void onScriptContextCreated(ScriptContextEvent event) { - // 6.x JSValue window = event.getBrowser().executeJavaScriptAndReturnValue("window"); window.asObject().setProperty("PluginHelper", UpmBridge.getBridge(event.getBrowser())); } }) - .prepareForV7(params -> { - // 7.x - JsObject window = params.frame().executeJavaScript("window"); - if (window != null) { - window.putProperty("PluginHelper", NewUpmBridge.getBridge(window)); - } - return InjectJsCallback.Response.proceed(); - }) .withURL(UpmFinder.getMainResourcePath(), UpmUtils.renderMap()) .build(); EventDispatcher.listen(DownloadEvent.UPDATE, new Listener() { @@ -57,6 +48,12 @@ public class UpmShowPane extends BasicPane { modernUIPane.redirect(UpmFinder.getMainResourcePath(), UpmUtils.renderMap()); } }); + EventDispatcher.listen(DownloadEvent.UPDATE, new Listener() { + @Override + public void on(Event event, String param) { + modernUIPane.redirect(UpmFinder.getMainResourcePath(), UpmUtils.renderMap()); + } + }); add(modernUIPane, BorderLayout.CENTER); } }