Package org.loboevolution.gui
Interface HtmlRendererContext
- All Known Implementing Classes:
HtmlRendererContextImpl,LocalHtmlRendererContext
public interface HtmlRendererContext
-
Method Summary
Modifier and TypeMethodDescriptionvoidOpens a simple message dialog.voidback()It should navigate back one page.voidblur()It should give up focus on the current browser window.voidclose()It should close the current browser window.booleanOpens a simple confirmation window.voiderror.voiderror.voidfocus()It should request focus for the current browser window.voidforward()forward.Gets the current URL in history.Should return true if and only if the current browser window is closed.intgetHistoryLength.Getter for the field htmlPanel.intgetInnerHeight.intgetInnerWidth.getNextURL.Getter for the field opener.intgetOuterHeight.intgetOuterWidth.Getter parent.getPreviousURL.doubledoublegetStatus.getTop()Getter top.If aUserAgentContextinstance was provided in the constructor, then that instance is returned.booleanisClosed()Should return true if and only if the current browser window is closed.booleanisTestEnabled.booleanisVisitedLink.voidlinkClicked(URL url, boolean isNewTab) Implements the link click.voidmoveInHistory(int offset) moveInHistory.voidConvenience method provided to allow loading a document into the renderer.voidImplements simple navigation with incremental rendering by invokingsubmitForm(String, URL, String, String, FormInput[])with a GET request method.booleanonContextMenu(HTMLElement element, MouseEvent event) This method must be overridden to implement a context menu.It should open a new browser window.voidopenImageViewer(String fullURL, InputStream stream) openImageViewer.voidopenImageViewer(URL srcUrl) openImageViewer.Shows a simple prompt dialog.voidreload()Implements reload as navigation to current URL.voidresizeBy(double byWidth, double byHeight) resizeBy.voidresizeTo(double width, double height) resizeTo.voidscroll(double x, double y) Changes the origin of the HTML block's scrollable area according to the position given.voidscrollBy(double x, double y) scrollBy.voidsetCursor.voidsetDefaultStatus(String message) setDefaultStatus.voidsetHtmlPanel(HtmlPanel panel) Setter for the field htmlPanel.voidsetOpener(HtmlRendererContext opener) Setter for the field opener.voidsetScrollx(double scrollx) voidsetScrolly(double scrolly) voidsetStatus.voidImplements simple navigation and form submission with incremental rendering and target processing, including frame lookup.voidwarn.voidwarn.
-
Method Details
-
getUserAgentContext
UserAgentContext getUserAgentContext()If aUserAgentContextinstance was provided in the constructor, then that instance is returned. Otherwise, an instance ofUserAgentContextis 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- aStringobject.- Returns:
- a boolean.
-
alert
Opens a simple message dialog.- Parameters:
message- aStringobject.
-
error
error.
- Parameters:
message- aStringobject.
-
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
Stringobject.
-
getOpener
HtmlRendererContext getOpener()Getter for the field opener.
- Returns:
- a
HtmlRendererContextobject.
-
getParent
HtmlRendererContext getParent()Getter parent.
- Returns:
- a
HtmlRendererContextobject.
-
getTop
HtmlRendererContext getTop()Getter top.
- Returns:
- a
HtmlRendererContextobject.
-
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
HtmlRendererContextobject.
-
isVisitedLink
isVisitedLink.
- Parameters:
link- aHTMLAnchorElementobject.- Returns:
- a boolean.
-
onContextMenu
This method must be overridden to implement a context menu.- Parameters:
element- aHTMLElementobject.event- aMouseEventobject.- 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- aIntegerobject.
-
openImageViewer
openImageViewer.
- Parameters:
srcUrl- aURLobject.
-
openImageViewer
openImageViewer.
- Parameters:
fullURL- aStringobject.stream- aInputStreamobject.
-
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- aStringobject.
-
warn
warn.
-
setDefaultStatus
setDefaultStatus.
- Parameters:
message- aStringobject.
-
setHtmlPanel
Setter for the field htmlPanel.
- Parameters:
panel- aHtmlPanelobject.
-
setOpener
Setter for the field opener.
- Parameters:
opener- aHtmlRendererContextobject.
-
setStatus
setStatus.
- Parameters:
message- aStringobject.
-
setCursor
setCursor.
- Parameters:
cursor- aCursorobject.
-
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
Booleanobject.
-
getNextURL
String getNextURL()getNextURL.
- Returns:
- a
Stringobject.
-
getPreviousURL
String getPreviousURL()getPreviousURL.
- Returns:
- a
Stringobject.
-
getHistoryLength
int getHistoryLength()getHistoryLength.
- Returns:
- a
Integerobject.
-
getStatus
String getStatus()getStatus.
- Returns:
- a
Stringobject.
-