Package org.xhtmlrenderer.swt
Class NaiveUserAgent
- java.lang.Object
-
- org.xhtmlrenderer.swt.NaiveUserAgent
-
- All Implemented Interfaces:
UserAgentCallback
@ParametersAreNonnullByDefault public class NaiveUserAgent extends Object implements UserAgentCallback
Naive user agent, copy of org.xhtmlrenderer.swing.NaiveUserAgent (but modified for SWT, of course).- Author:
- Vianney le Clément
-
-
Constructor Summary
Constructors Constructor Description NaiveUserAgent(org.eclipse.swt.graphics.Device device)Creates a new instance of NaiveUserAgent
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ImageResourcecreateImageResource(String uri, InputStream is)Factory method to generate ImageResources from a given Image.voiddisposeCache()Dispose all images in cache and clean the cache.StringgetBaseURL()byte[]getBinaryResource(String uri)CSSResourcegetCSSResource(String uri)ImageResourcegetImageResource(String uri)XMLResourcegetXMLResource(String uri)booleanisVisited(String uri)Gets the visited attribute of the NaiveUserAgent objectStringresolveURI(String uri)voidsetBaseURL(String url)
-
-
-
Method Detail
-
getCSSResource
public CSSResource getCSSResource(String uri)
- Specified by:
getCSSResourcein interfaceUserAgentCallback
-
getImageResource
public ImageResource getImageResource(String uri)
- Specified by:
getImageResourcein interfaceUserAgentCallback
-
createImageResource
protected 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 XMLResource getXMLResource(String uri)
- Specified by:
getXMLResourcein interfaceUserAgentCallback
-
isVisited
public boolean isVisited(String uri)
Gets the visited attribute of the NaiveUserAgent object- Specified by:
isVisitedin interfaceUserAgentCallback
-
setBaseURL
public void setBaseURL(String url)
- Specified by:
setBaseURLin interfaceUserAgentCallback
-
resolveURI
@Nullable @CheckReturnValue public String resolveURI(@Nullable String uri)
- Specified by:
resolveURIin interfaceUserAgentCallback
-
getBaseURL
public String getBaseURL()
- Specified by:
getBaseURLin interfaceUserAgentCallback
-
disposeCache
public void disposeCache()
Dispose all images in cache and clean the cache.
-
getBinaryResource
@Nullable @CheckReturnValue public byte[] getBinaryResource(String uri)
- Specified by:
getBinaryResourcein interfaceUserAgentCallback
-
-