Browse Source

Revert "CHART-23172 & CHART-23111 v7的jxbrowser没有正确关闭engine"

This reverts commit b069132341.
new-design
WeiYanglu 3 years ago
parent
commit
c7b284ad9e
  1. 6
      designer-base/src/main/java/com/fr/design/ui/ModernUIPane.java
  2. 4
      designer-base/src/main/java/com/fr/design/ui/compatible/ModernUIPaneFactory.java
  3. 11
      designer-base/src/main/java/com/fr/design/ui/compatible/NewModernUIPane.java

6
designer-base/src/main/java/com/fr/design/ui/ModernUIPane.java

@ -196,17 +196,13 @@ public class ModernUIPane<T> extends BasicPane {
private ModernUIPane<T> pane; private ModernUIPane<T> pane;
public Builder() { public Builder() {
this(BrowserType.HEAVYWEIGHT);
} }
public Builder(BrowserType browserType) { public Builder(BrowserType browserType) {
this.pane = new ModernUIPane<>(browserType); this.pane = new ModernUIPane<>(browserType);
} }
public Builder<T> init() {
this.pane = new ModernUIPane<>(BrowserType.HEAVYWEIGHT);
return this;
}
public Builder<T> prepare(ScriptContextListener contextListener) { public Builder<T> prepare(ScriptContextListener contextListener) {
pane.browser.addScriptContextListener(contextListener); pane.browser.addScriptContextListener(contextListener);
return this; return this;

4
designer-base/src/main/java/com/fr/design/ui/compatible/ModernUIPaneFactory.java

@ -13,9 +13,9 @@ public class ModernUIPaneFactory {
public static <T> ModernUIPane.Builder<T> modernUIPaneBuilder() { public static <T> ModernUIPane.Builder<T> modernUIPaneBuilder() {
if (isV7()) { if (isV7()) {
return new NewModernUIPane.Builder<T>().init(); return new NewModernUIPane.Builder<>();
} else { } else {
return new ModernUIPane.Builder<T>().init(); return new ModernUIPane.Builder<>();
} }
} }

11
designer-base/src/main/java/com/fr/design/ui/compatible/NewModernUIPane.java

@ -182,7 +182,8 @@ public class NewModernUIPane<T> extends ModernUIPane<T> {
public void disposeBrowser() { public void disposeBrowser() {
if (browser != null) { if (browser != null) {
browser.engine().close(); browser.close();
browser = null;
} }
} }
@ -203,13 +204,7 @@ public class NewModernUIPane<T> extends ModernUIPane<T> {
public static class Builder<T> extends ModernUIPane.Builder<T> { public static class Builder<T> extends ModernUIPane.Builder<T> {
private NewModernUIPane<T> pane; private NewModernUIPane<T> pane = new NewModernUIPane<>();
@Override
public ModernUIPane.Builder<T> init() {
this.pane = new NewModernUIPane<>();
return this;
}
public NewModernUIPane.Builder<T> prepare(InjectJsCallback callback) { public NewModernUIPane.Builder<T> prepare(InjectJsCallback callback) {
pane.browser.set(InjectJsCallback.class, callback); pane.browser.set(InjectJsCallback.class, callback);

Loading…
Cancel
Save