Class AbstractHtmlRendererContext

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void alert​(java.lang.String message)
      Opens an alert dialog.
      void back()
      Goes to the previous page in the browser's history.
      void blur()
      Relinquishes focus.
      void close()
      Closes the browser window, provided this is allowed for the current context.
      boolean confirm​(java.lang.String message)
      Opens a confirmation dialog.
      BrowserFrame createBrowserFrame()
      Creates a BrowserFrame instance.
      void focus()
      Requests focus for the current window.
      void forward()
      Goes forward one page.
      java.lang.String getCurrentURL()
      Gets the current URL in history.
      java.lang.String getDefaultStatus()  
      HTMLCollection getFrames()
      Gets a collection of frames from the document currently in the context.
      int getHistoryLength()
      Gets the number of pages in the history list.
      HtmlObject getHtmlObject​(HTMLElement element)
      Gets a HtmlObject instance that implements a OBJECT tag from HTML.
      java.lang.String getName()
      Gets the window name.
      java.lang.String getNextURL()
      Gets the next URL in the history.
      HtmlRendererContext getOpener()
      Gets the opener of the frame/window in the current context.
      HtmlRendererContext getParent()
      Gets the parent of the frame/window in the current context.
      java.lang.String getPreviousURL()
      Gets the previous URL in the history.
      java.lang.String getStatus()
      Gets the window status text.
      HtmlRendererContext getTop()
      Gets the top-most browser frame/window.
      UserAgentContext getUserAgentContext()
      Gets the user agent context.
      void goToHistoryURL​(java.lang.String url)
      Navigates to a URL in the history list.
      boolean isClosed()
      Returns false unless overridden.
      boolean isImageLoadingEnabled()
      Returns true unless overridden.
      boolean isVisitedLink​(HTMLLinkElement link)
      Returns false unless overridden.
      void linkClicked​(HTMLElement linkNode, java.net.URL url, java.lang.String target)
      Performs a link click.
      void moveInHistory​(int offset)
      Navigates the history according to the given offset.
      void navigate​(java.net.URL url, java.lang.String target)
      Navigates to the location given.
      boolean onContextMenu​(HTMLElement element, java.awt.event.MouseEvent event)
      Returns true unless overridden.
      boolean onDoubleClick​(HTMLElement element, java.awt.event.MouseEvent event)
      Returns true unless overridden.
      boolean onMouseClick​(HTMLElement element, java.awt.event.MouseEvent event)
      Returns true unless overridden.
      void onMouseOut​(HTMLElement element, java.awt.event.MouseEvent event)
      This method is called when the mouse no longer hovers a given element.
      void onMouseOver​(HTMLElement element, java.awt.event.MouseEvent event)
      This method is called when the mouse first hovers over an element.
      HtmlRendererContext open​(java.lang.String absoluteUrl, java.lang.String windowName, java.lang.String windowFeatures, boolean replace)
      Opens a separate browser window and renders a URL.
      HtmlRendererContext open​(java.net.URL url, java.lang.String windowName, java.lang.String windowFeatures, boolean replace)
      Opens a separate browser window and renders a URL.
      java.lang.String prompt​(java.lang.String message, java.lang.String inputDefault)
      Shows a prompt dialog.
      void reload()
      Reloads the current document.
      void resizeBy​(int byWidth, int byHeight)
      Resizes the window.
      void resizeTo​(int width, int height)
      Resizes the window.
      void scroll​(int x, int y)
      Scrolls the client area.
      void scrollBy​(int x, int y)
      Scrolls the client area.
      void setDefaultStatus​(java.lang.String value)  
      void setOpener​(HtmlRendererContext opener)
      Sets the context that opened the current frame/window.
      void setStatus​(java.lang.String message)
      Sets the window status text.
      void submitForm​(java.lang.String method, java.net.URL action, java.lang.String target, java.lang.String enctype, FormInput[] formInputs)
      Submits a HTML form.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractHtmlRendererContext

        public AbstractHtmlRendererContext()
    • Method Detail

      • alert

        public void alert​(java.lang.String message)
        Description copied from interface: HtmlRendererContext
        Opens an alert dialog.
        Specified by:
        alert in interface HtmlRendererContext
        Parameters:
        message - Message shown by the dialog.
      • close

        public void close()
        Description copied from interface: HtmlRendererContext
        Closes the browser window, provided this is allowed for the current context.
        Specified by:
        close in interface HtmlRendererContext
      • confirm

        public boolean confirm​(java.lang.String message)
        Description copied from interface: HtmlRendererContext
        Opens a confirmation dialog.
        Specified by:
        confirm in interface HtmlRendererContext
        Parameters:
        message - The message shown by the confirmation dialog.
        Returns:
        True if the user selects YES.
      • getHtmlObject

        public HtmlObject getHtmlObject​(HTMLElement element)
        Description copied from interface: HtmlRendererContext
        Gets a HtmlObject instance that implements a OBJECT tag from HTML.
        Specified by:
        getHtmlObject in interface HtmlRendererContext
        Parameters:
        element - The DOM element for the object, which may either represent an OBJECT, EMBED or an APPLET tag.
        Returns:
        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.
      • navigate

        public void navigate​(java.net.URL url,
                             java.lang.String target)
        Description copied from interface: HtmlRendererContext
        Navigates to the location given. Implementations should retrieve the URL content, parse it and render it.
        Specified by:
        navigate in interface HtmlRendererContext
        Parameters:
        url - The destination URL.
        target - Same as the target attribute in the HTML anchor tag, i.e. _top, _blank, etc.
      • onContextMenu

        public boolean onContextMenu​(HTMLElement element,
                                     java.awt.event.MouseEvent event)
        Returns true unless overridden.
        Specified by:
        onContextMenu in interface HtmlRendererContext
        Parameters:
        element - The narrowest element enclosing the mouse location.
        event - The mouse event.
        Returns:
        The method should return true to continue propagating the event, or false to stop propagating it.
      • onMouseOut

        public void onMouseOut​(HTMLElement element,
                               java.awt.event.MouseEvent event)
        Description copied from interface: HtmlRendererContext
        This method is called when the mouse no longer hovers a given element.
        Specified by:
        onMouseOut in interface HtmlRendererContext
        Parameters:
        element - The element that the mouse has just exited.
        event - The mouse event.
      • onMouseOver

        public void onMouseOver​(HTMLElement element,
                                java.awt.event.MouseEvent event)
        Description copied from interface: HtmlRendererContext
        This method is called when the mouse first hovers over an element.
        Specified by:
        onMouseOver in interface HtmlRendererContext
        Parameters:
        element - The element that the mouse has just entered.
        event - The mouse event.
      • open

        public HtmlRendererContext open​(java.lang.String absoluteUrl,
                                        java.lang.String windowName,
                                        java.lang.String windowFeatures,
                                        boolean replace)
        Description copied from interface: HtmlRendererContext
        Opens a separate browser window and renders a URL.
        Specified by:
        open in interface HtmlRendererContext
        Parameters:
        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).
        Returns:
        A new HtmlRendererContext instance.
      • open

        public HtmlRendererContext open​(java.net.URL url,
                                        java.lang.String windowName,
                                        java.lang.String windowFeatures,
                                        boolean replace)
        Description copied from interface: HtmlRendererContext
        Opens a separate browser window and renders a URL.
        Specified by:
        open in interface HtmlRendererContext
        Parameters:
        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).
        Returns:
        A new HtmlRendererContext instance.
      • prompt

        public java.lang.String prompt​(java.lang.String message,
                                       java.lang.String inputDefault)
        Description copied from interface: HtmlRendererContext
        Shows a prompt dialog.
        Specified by:
        prompt in interface HtmlRendererContext
        Parameters:
        message - The message shown by the dialog.
        inputDefault - The default input value.
        Returns:
        The user's input value.
      • scroll

        public void scroll​(int x,
                           int y)
        Description copied from interface: HtmlRendererContext
        Scrolls the client area.
        Specified by:
        scroll in interface HtmlRendererContext
        Parameters:
        x - Document's x coordinate.
        y - Document's y coordinate.
      • setStatus

        public void setStatus​(java.lang.String message)
        Description copied from interface: HtmlRendererContext
        Sets the window status text.
        Specified by:
        setStatus in interface HtmlRendererContext
        Parameters:
        message - A string.
      • submitForm

        public void submitForm​(java.lang.String method,
                               java.net.URL action,
                               java.lang.String target,
                               java.lang.String enctype,
                               FormInput[] formInputs)
        Description copied from interface: HtmlRendererContext
        Submits a HTML form. Note that when the the method is "GET", parameters are still expected to be part of formInputs.
        Specified by:
        submitForm in interface HtmlRendererContext
        Parameters:
        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.
      • onDoubleClick

        public boolean onDoubleClick​(HTMLElement element,
                                     java.awt.event.MouseEvent event)
        Returns true unless overridden.
        Specified by:
        onDoubleClick in interface HtmlRendererContext
        Parameters:
        element - The narrowest element enclosing the mouse location.
        event - The mouse event.
        Returns:
        The method should return true to continue propagating the event, or false to stop propagating it.
      • onMouseClick

        public boolean onMouseClick​(HTMLElement element,
                                    java.awt.event.MouseEvent event)
        Returns true unless overridden.
        Specified by:
        onMouseClick in interface HtmlRendererContext
        Parameters:
        element - The narrowest element enclosing the mouse location.
        event - The mouse event.
        Returns:
        The method should return true to continue propagating the event, or false to stop propagating it.
      • scrollBy

        public void scrollBy​(int x,
                             int y)
        Description copied from interface: HtmlRendererContext
        Scrolls the client area.
        Specified by:
        scrollBy in interface HtmlRendererContext
        Parameters:
        x - Horizontal pixels to scroll.
        y - Vertical pixels to scroll.
      • resizeBy

        public void resizeBy​(int byWidth,
                             int byHeight)
        Description copied from interface: HtmlRendererContext
        Resizes the window.
        Specified by:
        resizeBy in interface HtmlRendererContext
        Parameters:
        byWidth - The number of pixels to resize the width by.
        byHeight - The number of pixels to resize the height by.
      • resizeTo

        public void resizeTo​(int width,
                             int height)
        Description copied from interface: HtmlRendererContext
        Resizes the window.
        Specified by:
        resizeTo in interface HtmlRendererContext
        Parameters:
        width - The new width.
        height - The new height.