Interface HtmlRendererContext

All Known Implementing Classes:
HtmlRendererContextImpl, LocalHtmlRendererContext

public interface HtmlRendererContext
  • Method Details

    • getUserAgentContext

      UserAgentContext getUserAgentContext()
      If a UserAgentContext instance was provided in the constructor, then that instance is returned. Otherwise, an instance of UserAgentContext 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.

      Parameters:
      x - a Double object.
      y - a Double object.
    • getInnerWidth

      int getInnerWidth()

      getInnerWidth.

    • getInnerHeight

      int getInnerHeight()

      getInnerHeight.

    • getOuterWidth

      int getOuterWidth()

      getOuterWidth.

    • getOuterHeight

      int getOuterHeight()

      getOuterHeight.

    • linkClicked

      void linkClicked(URL url, boolean isNewTab)
      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

      boolean confirm(String message)
      Opens a simple confirmation window.
      Parameters:
      message - a String object.
      Returns:
      a boolean.
    • alert

      void alert(String message)
      Opens a simple message dialog.
      Parameters:
      message - a String object.
    • error

      void error(String message)

      error.

      Parameters:
      message - a String object.
    • error

      void error(String message, Throwable throwable)

      error.

      Parameters:
      message - a String object.
      throwable - a Throwable object.
    • 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

      Getter top.

      Returns:
      a HtmlRendererContext object.
    • open

      HtmlRendererContext open(URL url, String windowName, String windowFeatures, boolean replace)
      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

      boolean isVisitedLink(HTMLAnchorElement link)

      isVisitedLink.

      Parameters:
      link - a HTMLAnchorElement object.
      Returns:
      a boolean.
    • onContextMenu

      boolean onContextMenu(HTMLElement element, MouseEvent event)
      This method must be overridden to implement a context menu.
      Parameters:
      element - a HTMLElement object.
      event - a MouseEvent 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 - a Integer object.
    • openImageViewer

      void openImageViewer(URL srcUrl)

      openImageViewer.

      Parameters:
      srcUrl - a URL object.
    • openImageViewer

      void openImageViewer(String fullURL, InputStream stream)

      openImageViewer.

      Parameters:
      fullURL - a String object.
      stream - a InputStream object.
    • prompt

      String prompt(String message, String inputDefault)
      Shows a simple prompt dialog.
      Parameters:
      message - a String object.
      inputDefault - a String object.
      Returns:
      a String object.
    • 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.

      Parameters:
      byWidth - a Double object.
      byHeight - a Double object.
    • resizeTo

      void resizeTo(double width, double height)

      resizeTo.

      Parameters:
      width - a Double object.
      height - a Double object.
    • warn

      void warn(String message)

      warn.

      Parameters:
      message - a String object.
    • warn

      void warn(String message, Throwable throwable)

      warn.

      Parameters:
      message - a String object.
      throwable - a Throwable object.
    • setDefaultStatus

      void setDefaultStatus(String message)

      setDefaultStatus.

      Parameters:
      message - a String object.
    • setHtmlPanel

      void setHtmlPanel(HtmlPanel panel)

      Setter for the field htmlPanel.

      Parameters:
      panel - a HtmlPanel object.
    • setOpener

      void setOpener(HtmlRendererContext opener)

      Setter for the field opener.

      Parameters:
      opener - a HtmlRendererContext object.
    • setStatus

      void setStatus(String message)

      setStatus.

      Parameters:
      message - a String object.
    • setCursor

      void setCursor(Cursor cursor)

      setCursor.

      Parameters:
      cursor - a Cursor object.
    • submitForm

      void submitForm(String method, URL action, String target, String enctype, FormInput[] formInputs)
      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.
      Parameters:
      method - a String object.
      action - a URL object.
      target - a String object.
      enctype - a String object.
      formInputs - an array of FormInput objects.
      See Also:
    • 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.