|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Browser
The base interface for all browser engines. All browser engines must implement
this interface. To find information that describes how to create a Browser
instance please see the BrowserFactory class.
| Method Summary | |
|---|---|
CacheStorage |
getCacheStorage()
Returns the CacheStorage for the current browser type. |
java.awt.Component |
getComponent()
Returns a Swing component with embedded web browser control that allows displaying web pages. |
Configurable |
getConfigurable()
Returns API enabling or disabling some browser features such as javascript, plug-ins or images etc. |
java.lang.String |
getContent()
Returns the string that represents HTML content of a currently loaded document in WebBrowser. |
HttpCookieStorage |
getCookieStorage()
Returns the HttpCookieStorage for the current browser type. |
org.w3c.dom.Document |
getDocument()
Returns accessor for the document in the currently loaded page. |
NewWindowManager |
getNewWindowManager()
Returns the current NewWindowManager instance or null
if it's not present. |
BrowserServices |
getServices()
Returns the global browser services instance. |
BrowserType |
getType()
Returns type of current browser instance. |
void |
setContent(java.lang.String html)
Sets the specified HTML content to the current Browser document. |
void |
setContent(java.lang.String html,
java.lang.String baseURL)
Sets the specified HTML content with the baseURI to the current Browser document. |
void |
setUserAgent(java.lang.String userAgent)
Sets the user-agent string. |
java.awt.Image |
toImage(boolean wholePage)
Returns an image in which the currently loaded web page is rendered. |
java.awt.Image |
toImage(java.awt.Dimension dimension)
Returns an image in which the currently loaded web page is rendered. |
| Methods inherited from interface com.teamdev.jxbrowser.Navigation |
|---|
addNavigationListener, getNavigationListeners, goBack, goForward, isNavigationFinished, navigate, navigate, refresh, removeNavigationListener, stop, waitReady |
| Methods inherited from interface com.teamdev.jxbrowser.NavigationHistory |
|---|
addHistoryChangeListener, canGoBack, canGoForward, getAllHistory, getCurrentIndex, getCurrentLocation, getHistoryChangeListeners, removeHistoryChangeListener |
| Methods inherited from interface com.teamdev.jxbrowser.ContentLoading |
|---|
addProgressListener, getProgressListeners, removeProgressListener |
| Methods inherited from interface com.teamdev.jxbrowser.print.Printing |
|---|
print, print |
| Methods inherited from interface com.teamdev.jxbrowser.security.Security |
|---|
getHttpSecurityHandler, setHttpSecurityHandler |
| Methods inherited from interface com.teamdev.jxbrowser.ScriptRunner |
|---|
executeScript, registerFunction |
| Methods inherited from interface com.teamdev.jxbrowser.PageHost |
|---|
addStatusListener, addTitleListener, getContextMenuHandler, getStatusListeners, getStatusMessage, getTitle, getTitleListeners, removeStatusListener, removeTitleListener, setContextMenuHandler |
| Methods inherited from interface com.teamdev.jxbrowser.Disposable |
|---|
addDisposeListener, dispose, getDisposeListeners, isDisposed, removeDisposeListener |
| Method Detail |
|---|
void setContent(java.lang.String html)
NavigationListener.navigationFinished(NavigationFinishedEvent)
event.
It may be necessary when the document contains some resources
(such as images or JavaScript files) that require some time to
download.
html - a string that represents HTML content
to set to the current document.setContent(String, String),
getContent(),
NavigationListener.navigationFinished(NavigationFinishedEvent)
void setContent(java.lang.String html,
java.lang.String baseURL)
baseURI to the current Browser document.
This method is executing asynchronously. To make sure that the new
HTML content was applied to the document completely, use the
NavigationListener.navigationFinished(NavigationFinishedEvent)
event.
It may be necessary when the document contains some resources
(such as images or JavaScript files) that require some time to
download.
Note: This method will not set BaseURL if html string contains some HTML errors.
html - a string that represents HTML content to be set to the current document.baseURL - a string that represents a default address or a default target for all links on a page.setContent(String),
getContent(),
NavigationListener.navigationFinished(NavigationFinishedEvent)java.lang.String getContent()
NavigationListener.navigationFinished(NavigationFinishedEvent)
event.
setContent(String),
setContent(String, String),
NavigationListener.navigationFinished(NavigationFinishedEvent)BrowserType getType()
BrowserTypejava.awt.Component getComponent()
Browser
instance and embed it into JFrame:
Browser browser = BrowserFactory.createBrowser();
JFrame frame = new JFrame();
frame.add(browser.getComponent(), BorderLayout.CENTER);
frame.setVisible(true);
org.w3c.dom.Document getDocument()
NavigationListener.navigationFinished(NavigationFinishedEvent)
event.
null if it's not presentNavigationListener.navigationFinished(NavigationFinishedEvent)java.awt.Image toImage(boolean wholePage)
wholePage - if true returns the whole page, not just what is visible
java.awt.Image toImage(java.awt.Dimension dimension)
dimension - - dimension of area to render, in CSS pixels
NewWindowManager getNewWindowManager()
NewWindowManager instance or null
if it's not present. To set the specified NewWindowManager
implementation see the
BrowserServices.setNewWindowManager(NewWindowManager)
method.
NewWindowManager instance or null
if it's not present.BrowserServices.setNewWindowManager(NewWindowManager),
BrowserServices.getNewWindowManager(),
getServices()BrowserServices getServices()
BrowserServices.getInstance() method.
BrowserServices.getInstance()HttpCookieStorage getCookieStorage()
HttpCookieStorage for the current browser type.
HttpCookieStorage instance.
UnsupportedBrowserTypeException - when the current browserType
doesn't provide any cookie storage.getType(),
BrowserServices.getCookieStorage(BrowserType)Configurable getConfigurable()
void setUserAgent(java.lang.String userAgent)
userAgent - the user-agent string.
java.lang.NullPointerException - when userAgent is null.CacheStorage getCacheStorage()
CacheStorage for the current browser type.
CacheStorage instance.
UnsupportedBrowserTypeException - when the current browserType
doesn't provide any cache storage.getType(),
BrowserServices.getCacheStorage(BrowserType)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||