From c7b284ad9ef40d494999eb713f33ff33029b3e96 Mon Sep 17 00:00:00 2001 From: WeiYanglu Date: Wed, 23 Mar 2022 16:49:00 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"CHART-23172=20&=20CHART-23111=20v7?= =?UTF-8?q?=E7=9A=84jxbrowser=E6=B2=A1=E6=9C=89=E6=AD=A3=E7=A1=AE=E5=85=B3?= =?UTF-8?q?=E9=97=ADengine"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b069132341ab1f8a25d8bc1f07bdb97a69f656b5. --- .../src/main/java/com/fr/design/ui/ModernUIPane.java | 6 +----- .../fr/design/ui/compatible/ModernUIPaneFactory.java | 4 ++-- .../com/fr/design/ui/compatible/NewModernUIPane.java | 11 +++-------- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/ui/ModernUIPane.java b/designer-base/src/main/java/com/fr/design/ui/ModernUIPane.java index 16b09392f5..09fa2bbc08 100644 --- a/designer-base/src/main/java/com/fr/design/ui/ModernUIPane.java +++ b/designer-base/src/main/java/com/fr/design/ui/ModernUIPane.java @@ -196,17 +196,13 @@ public class ModernUIPane extends BasicPane { private ModernUIPane pane; public Builder() { + this(BrowserType.HEAVYWEIGHT); } public Builder(BrowserType browserType) { this.pane = new ModernUIPane<>(browserType); } - public Builder init() { - this.pane = new ModernUIPane<>(BrowserType.HEAVYWEIGHT); - return this; - } - public Builder prepare(ScriptContextListener contextListener) { pane.browser.addScriptContextListener(contextListener); return this; diff --git a/designer-base/src/main/java/com/fr/design/ui/compatible/ModernUIPaneFactory.java b/designer-base/src/main/java/com/fr/design/ui/compatible/ModernUIPaneFactory.java index e6b13ce13e..68b8950f7c 100644 --- a/designer-base/src/main/java/com/fr/design/ui/compatible/ModernUIPaneFactory.java +++ b/designer-base/src/main/java/com/fr/design/ui/compatible/ModernUIPaneFactory.java @@ -13,9 +13,9 @@ public class ModernUIPaneFactory { public static ModernUIPane.Builder modernUIPaneBuilder() { if (isV7()) { - return new NewModernUIPane.Builder().init(); + return new NewModernUIPane.Builder<>(); } else { - return new ModernUIPane.Builder().init(); + return new ModernUIPane.Builder<>(); } } diff --git a/designer-base/src/main/java/com/fr/design/ui/compatible/NewModernUIPane.java b/designer-base/src/main/java/com/fr/design/ui/compatible/NewModernUIPane.java index 3c30afbf06..0b56fc0ad6 100644 --- a/designer-base/src/main/java/com/fr/design/ui/compatible/NewModernUIPane.java +++ b/designer-base/src/main/java/com/fr/design/ui/compatible/NewModernUIPane.java @@ -182,7 +182,8 @@ public class NewModernUIPane extends ModernUIPane { public void disposeBrowser() { if (browser != null) { - browser.engine().close(); + browser.close(); + browser = null; } } @@ -203,13 +204,7 @@ public class NewModernUIPane extends ModernUIPane { public static class Builder extends ModernUIPane.Builder { - private NewModernUIPane pane; - - @Override - public ModernUIPane.Builder init() { - this.pane = new NewModernUIPane<>(); - return this; - } + private NewModernUIPane pane = new NewModernUIPane<>(); public NewModernUIPane.Builder prepare(InjectJsCallback callback) { pane.browser.set(InjectJsCallback.class, callback);