Package org.loboevolution.gui
Interface HtmlRendererContext
- All Known Implementing Classes:
HtmlRendererContextImpl
,LocalHtmlRendererContext
public interface HtmlRendererContext
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Opens a simple message dialog.void
back()
It should navigate back one page.void
blur()
It should give up focus on the current browser window.void
close()
It should close the current browser window.boolean
Opens a simple confirmation window.void
error.void
error.void
focus()
It should request focus for the current browser window.void
forward()
forward.Gets the current URL in history.Should return true if and only if the current browser window is closed.int
getHistoryLength.Getter for the field htmlPanel.int
getInnerHeight.int
getInnerWidth.getNextURL.Getter for the field opener.int
getOuterHeight.int
getOuterWidth.Getter parent.getPreviousURL.double
double
getStatus.getTop()
Getter top.If aUserAgentContext
instance was provided in the constructor, then that instance is returned.boolean
isClosed()
Should return true if and only if the current browser window is closed.boolean
isTestEnabled.boolean
isVisitedLink.void
linkClicked
(URL url, boolean isNewTab) Implements the link click.void
moveInHistory
(int offset) moveInHistory.void
Convenience method provided to allow loading a document into the renderer.void
Implements simple navigation with incremental rendering by invokingsubmitForm(String, URL, String, String, FormInput[])
with a GET request method.boolean
onContextMenu
(HTMLElement element, MouseEvent event) This method must be overridden to implement a context menu.It should open a new browser window.void
openImageViewer
(String fullURL, InputStream stream) openImageViewer.void
openImageViewer
(URL srcUrl) openImageViewer.Shows a simple prompt dialog.void
reload()
Implements reload as navigation to current URL.void
resizeBy
(double byWidth, double byHeight) resizeBy.void
resizeTo
(double width, double height) resizeTo.void
scroll
(double x, double y) Changes the origin of the HTML block's scrollable area according to the position given.void
scrollBy
(double x, double y) scrollBy.void
setCursor.void
setDefaultStatus
(String message) setDefaultStatus.void
setHtmlPanel
(HtmlPanel panel) Setter for the field htmlPanel.void
setOpener
(HtmlRendererContext opener) Setter for the field opener.void
setScrollx
(double scrollx) void
setScrolly
(double scrolly) void
setStatus.void
Implements simple navigation and form submission with incremental rendering and target processing, including frame lookup.void
warn.void
warn.
-
Method Details
-
getUserAgentContext
UserAgentContext getUserAgentContext()If aUserAgentContext
instance was provided in the constructor, then that instance is returned. Otherwise, an instance ofUserAgentContext
is created and returned.The context returned by this method is used by local request facilities and other parts of the renderer.
-
getCurrentURL
String getCurrentURL()Gets the current URL in history. -
getHtmlPanel
HtmlPanel getHtmlPanel()Getter for the field htmlPanel.
-
getScrollx
double getScrollx() -
setScrollx
void setScrollx(double scrollx) -
getScrolly
double getScrolly() -
setScrolly
void setScrolly(double scrolly) -
scroll
void scroll(double x, double y) Changes the origin of the HTML block's scrollable area according to the position given.This method may be called outside of the GUI thread. The operation is scheduled immediately in that thread as needed.
- Parameters:
x
- The new x coordinate for the origin.y
- The new y coordinate for the origin.
-
scrollBy
void scrollBy(double x, double y) scrollBy.
-
getInnerWidth
int getInnerWidth()getInnerWidth.
-
getInnerHeight
int getInnerHeight()getInnerHeight.
-
getOuterWidth
int getOuterWidth()getOuterWidth.
-
getOuterHeight
int getOuterHeight()getOuterHeight.
-
linkClicked
Implements the link click. -
back
void back()It should navigate back one page. This implementation does nothing and should be overridden. -
forward
void forward()forward.
-
blur
void blur()It should give up focus on the current browser window. This implementation does nothing and should be overridden. -
close
void close()It should close the current browser window. This implementation does nothing and should be overridden. -
focus
void focus()It should request focus for the current browser window. This implementation does nothing and should be overridden. -
confirm
Opens a simple confirmation window.- Parameters:
message
- aString
object.- Returns:
- a boolean.
-
alert
Opens a simple message dialog.- Parameters:
message
- aString
object.
-
error
error.
- Parameters:
message
- aString
object.
-
error
error.
-
getDefaultStatus
String getDefaultStatus()Should return true if and only if the current browser window is closed. This implementation returns false and should be overridden.- Returns:
- a
String
object.
-
getOpener
HtmlRendererContext getOpener()Getter for the field opener.
- Returns:
- a
HtmlRendererContext
object.
-
getParent
HtmlRendererContext getParent()Getter parent.
- Returns:
- a
HtmlRendererContext
object.
-
getTop
HtmlRendererContext getTop()Getter top.
- Returns:
- a
HtmlRendererContext
object.
-
open
It should open a new browser window. This implementation does nothing and should be overridden.- Parameters:
url
- The requested URL.windowName
- A window identifier.windowFeatures
- WindowImpl features specified in a format equivalent to that of window.open() in Javascript.replace
- Whether an existing window with the same name should be replaced.- Returns:
- a
HtmlRendererContext
object.
-
isVisitedLink
isVisitedLink.
- Parameters:
link
- aHTMLAnchorElement
object.- Returns:
- a boolean.
-
onContextMenu
This method must be overridden to implement a context menu.- Parameters:
element
- aHTMLElement
object.event
- aMouseEvent
object.- Returns:
- a boolean.
-
isClosed
boolean isClosed()Should return true if and only if the current browser window is closed. This implementation returns false and should be overridden.- Returns:
- a boolean.
-
moveInHistory
void moveInHistory(int offset) moveInHistory.
- Parameters:
offset
- aInteger
object.
-
openImageViewer
openImageViewer.
- Parameters:
srcUrl
- aURL
object.
-
openImageViewer
openImageViewer.
- Parameters:
fullURL
- aString
object.stream
- aInputStream
object.
-
prompt
Shows a simple prompt dialog. -
reload
void reload()Implements reload as navigation to current URL. Override to implement a more robust reloading mechanism. -
resizeBy
void resizeBy(double byWidth, double byHeight) resizeBy.
-
resizeTo
void resizeTo(double width, double height) resizeTo.
-
warn
warn.
- Parameters:
message
- aString
object.
-
warn
warn.
-
setDefaultStatus
setDefaultStatus.
- Parameters:
message
- aString
object.
-
setHtmlPanel
Setter for the field htmlPanel.
- Parameters:
panel
- aHtmlPanel
object.
-
setOpener
Setter for the field opener.
- Parameters:
opener
- aHtmlRendererContext
object.
-
setStatus
setStatus.
- Parameters:
message
- aString
object.
-
setCursor
setCursor.
- Parameters:
cursor
- aCursor
object.
-
submitForm
Implements simple navigation and form submission with incremental rendering and target processing, including frame lookup. Should be overridden to allow for more robust browser navigation and form submission.Notes:
- Document encoding is defined by {link #getDocumentCharset(URLConnection)}.
- Caching is not implemented.
- Cookies are not implemented.
- Incremental rendering is not optimized for ignorable document change notifications.
- Other HTTP features are not implemented.
- The only form encoding type supported is application/x-www-form-urlencoded.
- Navigation is normally asynchronous.
-
isTestEnabled
boolean isTestEnabled()isTestEnabled.
- Returns:
- a
Boolean
object.
-
getNextURL
String getNextURL()getNextURL.
- Returns:
- a
String
object.
-
getPreviousURL
String getPreviousURL()getPreviousURL.
- Returns:
- a
String
object.
-
getHistoryLength
int getHistoryLength()getHistoryLength.
- Returns:
- a
Integer
object.
-
getStatus
String getStatus()getStatus.
- Returns:
- a
String
object.
-