|
JDIC API V0.9 Release 1 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A IWebBrowser
component represents a blank rectangular area of
the screen onto which the application can display webpages or from which the
application can trap events from the browser window. In order to show a
Browser component in GUI, user need to add Browser to a top-level container,
such as Frame
.
The class that is interested in processing a Browser event should implement
interface WebBrowserListener
, and the object created with
that class should use Browser's addWebBrowserListener
method
to register as a listener.
IBrowserEngine
,
WebBrowserEvent
,
WebBrowserListener
Method Summary | |
void |
addWebBrowserListener(WebBrowserListener listener)
Adds a WebBrowserEvent listener. |
java.awt.Component |
asComponent()
Returns the component to which the Browser paints. |
void |
back()
Navigates to the previous session history item. |
void |
dispatchWebBrowserEvent(WebBrowserEvent event)
|
java.lang.String |
executeScript(java.lang.String javaScript)
Executes specified JavaScript code in a currently opened document. |
void |
forward()
Navigates to the next session history item. |
IBrowserEngine |
getBrowserEngine()
The BrowserEngine that was responsible for creating the browser instance. |
java.lang.String |
getContent()
Returns the HTML content of a document, opened in a browser. |
java.lang.String |
getInitFailureMessage()
|
int |
getInstanceNum()
A IWebBrowser must have a ticket to identify itself, here is the instance num.For a IWebBrowser instance, a native browser instance will be created to deal with its requests, this instance num will be used get according native browser instance. |
int |
getNativeWindow()
Get the windows' handler of native window |
java.net.URL |
getURL()
Retrieves the URL that is currently being displayed. |
boolean |
isBackEnabled()
|
boolean |
isForwardEnabled()
|
boolean |
isInitialized()
|
boolean |
isSynchronize()
If the webbrowser works under synchronize model |
void |
refresh()
Reloads the URL that is currently being displayed in the WebBrowser component. |
void |
removeWebBrowserListener(WebBrowserListener listener)
Removes a WebBrowserEvent listener. |
void |
setContent(java.lang.String htmlContent)
Sets new HTML content. |
void |
setInitFailureMessage(java.lang.String msg)
|
void |
setInitialized(boolean b)
Set if the IWebBrowser has been initialized. |
void |
setURL()
Sets the document to be a blank page. |
void |
setURL(java.net.URL url)
Navigates to a resource identified by an URL using HTTP GET method. |
void |
setURL(java.net.URL url,
java.lang.String postData)
Navigates to a resource identified by an URL using HTTP POST method. |
void |
stop()
Stops loading of the current URL. |
Method Detail |
public void addWebBrowserListener(WebBrowserListener listener)
WebBrowserEvent
listener.
listener
- object which implements WebBrowserListener interface.public void removeWebBrowserListener(WebBrowserListener listener)
WebBrowserEvent
listener.
listener
- object which implements WebBrowserListener interface. If the
listener was not in the listeners list, then no listener will
be removed.public boolean isSynchronize()
public java.awt.Component asComponent()
public java.net.URL getURL()
null
if the
WebBrowser object is not ready with initialization of itself.public void setURL()
public void setURL(java.net.URL url)
url
- the URL to navigate.public void setURL(java.net.URL url, java.lang.String postData)
url
- the URL to navigate.postData
- Data to send to the server during the HTTP POST transaction.public java.lang.String getContent()
public void setContent(java.lang.String htmlContent)
htmlContent
- the HTML content to set.public java.lang.String executeScript(java.lang.String javaScript)
WebBrowserListener
.
public void back()
public void forward()
public void refresh()
public void stop()
public IBrowserEngine getBrowserEngine()
BrowserEngine
that was responsible for
creating this browser instance.public boolean isBackEnabled()
public boolean isForwardEnabled()
public boolean isInitialized()
public int getInstanceNum()
public int getNativeWindow()
public void dispatchWebBrowserEvent(WebBrowserEvent event)
event
- public void setInitFailureMessage(java.lang.String msg)
public java.lang.String getInitFailureMessage()
public void setInitialized(boolean b)
b
-
|
JDIC API V0.9 Release 1 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, working code examples, license terms and bug report information.
Copyright (c) 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.