Class NaiveUserAgent

java.lang.Object
org.xhtmlrenderer.swt.NaiveUserAgent
All Implemented Interfaces:
org.xhtmlrenderer.extend.UserAgentCallback

@ParametersAreNonnullByDefault public class NaiveUserAgent extends Object implements org.xhtmlrenderer.extend.UserAgentCallback
Naive user agent, copy of org.xhtmlrenderer.swing.NaiveUserAgent (but modified for SWT, of course).
Author:
Vianney le Clément
  • Constructor Details

    • NaiveUserAgent

      public NaiveUserAgent(org.eclipse.swt.graphics.Device device)
      Creates a new instance of NaiveUserAgent
  • Method Details

    • getCSSResource

      public org.xhtmlrenderer.resource.CSSResource getCSSResource(String uri)
      Specified by:
      getCSSResource in interface org.xhtmlrenderer.extend.UserAgentCallback
    • getImageResource

      public org.xhtmlrenderer.resource.ImageResource getImageResource(String uri)
      Specified by:
      getImageResource in interface org.xhtmlrenderer.extend.UserAgentCallback
    • createImageResource

      protected org.xhtmlrenderer.resource.ImageResource createImageResource(String uri, InputStream is)
      Factory method to generate ImageResources from a given Image. May be overridden in subclass.
      Parameters:
      uri - The URI for the image, resolved to an absolute URI.
      is - Stream of the image; may be null (for example, if image could not be loaded).
      Returns:
      An ImageResource containing the image.
    • getXMLResource

      public org.xhtmlrenderer.resource.XMLResource getXMLResource(String uri)
      Specified by:
      getXMLResource in interface org.xhtmlrenderer.extend.UserAgentCallback
    • isVisited

      public boolean isVisited(String uri)
      Gets the visited attribute of the NaiveUserAgent object
      Specified by:
      isVisited in interface org.xhtmlrenderer.extend.UserAgentCallback
    • setBaseURL

      public void setBaseURL(String url)
      Specified by:
      setBaseURL in interface org.xhtmlrenderer.extend.UserAgentCallback
    • resolveURI

      @Nullable @CheckReturnValue public String resolveURI(@Nullable String uri)
      Specified by:
      resolveURI in interface org.xhtmlrenderer.extend.UserAgentCallback
    • getBaseURL

      public String getBaseURL()
      Specified by:
      getBaseURL in interface org.xhtmlrenderer.extend.UserAgentCallback
    • disposeCache

      public void disposeCache()
      Dispose all images in cache and clean the cache.
    • getBinaryResource

      @Nullable @CheckReturnValue public byte[] getBinaryResource(String uri)
      Specified by:
      getBinaryResource in interface org.xhtmlrenderer.extend.UserAgentCallback