Class BrowserUserAgent

java.lang.Object
org.xhtmlrenderer.swt.NaiveUserAgent
org.xhtmlrenderer.demo.browser.swt.BrowserUserAgent
All Implemented Interfaces:
UserAgentCallback

@ParametersAreNonnullByDefault public class BrowserUserAgent extends NaiveUserAgent
  • Field Details

  • Constructor Details

    • BrowserUserAgent

      public BrowserUserAgent(org.eclipse.swt.graphics.Device device)
  • Method Details

    • resolveURI

      @Nullable @CheckReturnValue public String resolveURI(@Nullable String uri)
      Description copied from interface: UserAgentCallback
      Used to find an uri that may be relative to the BaseURL. The returned value will always only be used via methods in the same implementation of this interface, therefore may be a private uri-space.
      Specified by:
      resolveURI in interface UserAgentCallback
      Overrides:
      resolveURI in class NaiveUserAgent
      Parameters:
      uri - an absolute or relative (to baseURL) uri to be resolved.
      Returns:
      the full uri in uri-spaces known to the current implementation.
    • setBaseURL

      public void setBaseURL(String url)
      Description copied from interface: UserAgentCallback
      Does not need to be a correct URL, only an identifier that the implementation can resolve.
      Specified by:
      setBaseURL in interface UserAgentCallback
      Overrides:
      setBaseURL in class NaiveUserAgent
      Parameters:
      url - A URL against which relative references can be resolved.
    • resolveFullURI

      public String resolveFullURI(String uri)
    • getXMLResource

      public XMLResource getXMLResource(String uri)
      Description copied from interface: UserAgentCallback
      Retrieves the XML at the given URI. This is a synchronous call.
      Specified by:
      getXMLResource in interface UserAgentCallback
      Overrides:
      getXMLResource in class NaiveUserAgent
      Parameters:
      uri - Location of the XML
      Returns:
      A XMLResource for the content at the URI.
    • getCSSResource

      public CSSResource getCSSResource(String uri)
      Description copied from interface: UserAgentCallback
      Retrieves the CSS at the given URI. This is a synchronous call.
      Specified by:
      getCSSResource in interface UserAgentCallback
      Overrides:
      getCSSResource in class NaiveUserAgent
      Parameters:
      uri - Location of the CSS
      Returns:
      A CSSResource for the content at the URI.
    • getImageResource

      public ImageResource getImageResource(String uri)
      Description copied from interface: UserAgentCallback
      Retrieves the Image at the given URI. This is a synchronous call.
      Specified by:
      getImageResource in interface UserAgentCallback
      Overrides:
      getImageResource in class NaiveUserAgent
      Parameters:
      uri - Location of the image
      Returns:
      An ImageResource for the content at the URI.
    • getNotFoundDocument

      private XMLResource getNotFoundDocument(String uri)
      Used internally when a document can't be loaded--returns XHTML as an XMLResource indicating that fact.
      Parameters:
      uri - The URI which could not be loaded.
      Returns:
      An XMLResource containing XML which about the failure.
    • isVisited

      public boolean isVisited(String uri)
      Description copied from class: NaiveUserAgent
      Gets the visited attribute of the NaiveUserAgent object
      Specified by:
      isVisited in interface UserAgentCallback
      Overrides:
      isVisited in class NaiveUserAgent
      Parameters:
      uri - A URI which may have been visited by this user agent.
      Returns:
      The visited value
    • getDemos

      public DemosNavigation getDemos()
    • getHistory

      public History getHistory()