alert
public void alert(String message)
Opens an alert dialog.
message
- Message shown by the dialog.
back
public void back()
Goes to the previous page in the browser's history.
blur
public void blur()
Relinquishes focus.
close
public void close()
Closes the browser window, provided this
is allowed for the current context.
confirm
public boolean confirm(String message)
Opens a confirmation dialog.
message
- The message shown by the confirmation dialog.
- True if the user selects YES.
focus
public void focus()
Requests focus for the current window.
getDefaultStatus
public String getDefaultStatus()
getFrames
public HTMLCollection getFrames()
Gets a collection of frames from the document
currently in the context.
getHtmlObject
public HtmlObject getHtmlObject(HTMLElement element)
Gets a HtmlObject
instance that implements
a OBJECT tag from HTML.
element
- The DOM element for the object, which may
either represent an OBJECT, EMBED or an APPLET tag.
- Implementations of this method must return
null
if they have any problems producing a HtmlObject
instance.
This is particularly true of OBJECT tags, where inner HTML of
the tag must be rendered if the OBJECT content cannot be handled.
getName
public String getName()
Gets the window name.
getOpener
public HtmlRendererContext getOpener()
Gets the opener of the window in the current context.
getParent
public HtmlRendererContext getParent()
Gets the parent of the window in the current context.
getStatus
public String getStatus()
Gets the window status text.
getUserAgentContext
public UserAgentContext getUserAgentContext()
Gets the browser context.
isClosed
public boolean isClosed()
Gets a value indicating if the window is closed.
isVisitedLink
public boolean isVisitedLink(HTMLLinkElement link)
It should return true if the link provided has been visited.
linkClicked
public void linkClicked(HTMLElement linkNode,
URL url,
String target)
linkNode
- The HTML node that was clicked.url
- The destination URL.target
- Same as the target attribute in the HTML anchor tag, i.e. _top, _blank, etc.
navigate
public void navigate(URL url,
String target)
Navigates to the location given. Implementations should
retrieve the URL content, parse it and render it.
url
- The destination URL.target
- Same as the target attribute in the HTML anchor tag, i.e. _top, _blank, etc.
onContextMenu
public void onContextMenu(HTMLElement element,
java.awt.event.MouseEvent event)
This method is called when a visual element is right-clicked.
element
- The narrowest element enclosing the mouse location.event
- The mouse event.
onMouseOut
public void onMouseOut(HTMLElement element,
java.awt.event.MouseEvent event)
This method is called when the mouse no longer hovers a given element.
element
- The element that the mouse has just exited.event
- The mouse event.
onMouseOver
public void onMouseOver(HTMLElement element,
java.awt.event.MouseEvent event)
This method is called when the mouse first hovers over an element.
element
- The element that the mouse has just entered.event
- The mouse event.
open
public HtmlRendererContext open(String absoluteUrl,
String windowName,
String windowFeatures,
boolean replace)
Use open(URL,String,String,boolean)
instead.
Opens a separate browser window and renders a URL.
absoluteUrl
- The URL to be rendered.windowName
- The name of the new window.windowFeatures
- The features of the new window (same as in Javascript open method).replace
-
open
public HtmlRendererContext open(URL url,
String windowName,
String windowFeatures,
boolean replace)
Opens a separate browser window and renders a URL.
url
- The URL to be rendered.windowName
- The name of the new window.windowFeatures
- The features of the new window (same as in Javascript open method).replace
-
prompt
public String prompt(String message,
String inputDefault)
Shows a prompt dialog.
message
- The message shown by the dialog.inputDefault
- The default input value.
reload
public void reload()
Reloads the current document.
scroll
public void scroll(int x,
int y)
Scrolls the client area.
x
- Document's x coordinate.y
- Document's y coordinate.
setDefaultStatus
public void setDefaultStatus(String value)
setOpener
public void setOpener(HtmlRendererContext opener)
Sets the context that opened the window of the current one.
setStatus
public void setStatus(String message)
Sets the window status text.
submitForm
public void submitForm(String method,
URL action,
String target,
String enctype,
FormInput[] formInputs)
Submits a HTML form. Note that when the the method is "GET", parameters
are still expected to be part of formInputs
.
method
- The request method, GET or POST.action
- The destination URL.target
- Same as the target attribute in the FORM tag, i.e. _blank, _top, etc.enctype
- The encoding type.formInputs
- An array of FormInput
instances.