|
|
@ -11,12 +11,14 @@ import com.fr.web.struct.AssembleComponent; |
|
|
|
import com.teamdev.jxbrowser.browser.callback.InjectJsCallback; |
|
|
|
import com.teamdev.jxbrowser.browser.callback.InjectJsCallback; |
|
|
|
import com.teamdev.jxbrowser.chromium.Browser; |
|
|
|
import com.teamdev.jxbrowser.chromium.Browser; |
|
|
|
import com.teamdev.jxbrowser.chromium.BrowserType; |
|
|
|
import com.teamdev.jxbrowser.chromium.BrowserType; |
|
|
|
|
|
|
|
import com.teamdev.jxbrowser.chromium.JSObject; |
|
|
|
import com.teamdev.jxbrowser.chromium.JSValue; |
|
|
|
import com.teamdev.jxbrowser.chromium.JSValue; |
|
|
|
import com.teamdev.jxbrowser.chromium.events.LoadListener; |
|
|
|
import com.teamdev.jxbrowser.chromium.events.LoadListener; |
|
|
|
import com.teamdev.jxbrowser.chromium.events.ScriptContextAdapter; |
|
|
|
import com.teamdev.jxbrowser.chromium.events.ScriptContextAdapter; |
|
|
|
import com.teamdev.jxbrowser.chromium.events.ScriptContextEvent; |
|
|
|
import com.teamdev.jxbrowser.chromium.events.ScriptContextEvent; |
|
|
|
import com.teamdev.jxbrowser.chromium.events.ScriptContextListener; |
|
|
|
import com.teamdev.jxbrowser.chromium.events.ScriptContextListener; |
|
|
|
import com.teamdev.jxbrowser.chromium.swing.BrowserView; |
|
|
|
import com.teamdev.jxbrowser.chromium.swing.BrowserView; |
|
|
|
|
|
|
|
import com.teamdev.jxbrowser.event.Observer; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.JDialog; |
|
|
|
import javax.swing.JDialog; |
|
|
|
import javax.swing.SwingUtilities; |
|
|
|
import javax.swing.SwingUtilities; |
|
|
@ -157,6 +159,36 @@ public class ModernUIPane<T> extends BasicPane { |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void disposeBrowser() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(browser != null) { |
|
|
|
|
|
|
|
browser.dispose(); |
|
|
|
|
|
|
|
browser = null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void clearCache() { |
|
|
|
|
|
|
|
if (browser != null) { |
|
|
|
|
|
|
|
browser.getCacheStorage().clearCache(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void executeJavaScript(String javaScript) { |
|
|
|
|
|
|
|
if (browser != null) { |
|
|
|
|
|
|
|
browser.executeJavaScript(javaScript); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public JSObject getEmptyJSObjectV6() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (browser != null) { |
|
|
|
|
|
|
|
return browser.executeJavaScriptAndReturnValue("var __empty_props__ = {};__empty_props__").asObject(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static class Builder<T> implements BuilderDiff<T> { |
|
|
|
public static class Builder<T> implements BuilderDiff<T> { |
|
|
|
|
|
|
|
|
|
|
|
private ModernUIPane<T> pane; |
|
|
|
private ModernUIPane<T> pane; |
|
|
@ -293,6 +325,12 @@ public class ModernUIPane<T> extends BasicPane { |
|
|
|
return this; |
|
|
|
return this; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public Builder<T> prepareForV7(Class event, Observer listener) { |
|
|
|
|
|
|
|
// do nothing
|
|
|
|
|
|
|
|
return this; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ModernUIPane<T> build() { |
|
|
|
public ModernUIPane<T> build() { |
|
|
|
return pane; |
|
|
|
return pane; |
|
|
|
} |
|
|
|
} |
|
|
|