public SWTXHTMLRenderer(Composite parent, int style) { super(parent, style); init(); }
/** * Loads and renders a Document given a uri. The uri is resolved by the * UserAgentCallback * * @param uri */ public void setDocument(String uri) { setDocument(loadDocument(uri), uri); }
/** * @param e * @return the form corresponding to element <code>e</code> or * <code>null</code> if none */ public XhtmlForm getForm(Element e) { ReplacedElementFactory ref = getSharedContext() .getReplacedElementFactory(); if (ref != null && ref instanceof SWTXhtmlReplacedElementFactory) { return ((SWTXhtmlReplacedElementFactory) ref).getForm(e); } return null; }
/** * Renders an XML Document instance. Make sure that no relative resources * are needed * * @param doc The document to render. */ public void setDocument(Document doc) { setDocument(doc, ""); }
protected void init() { getSharedContext().setReplacedElementFactory( new SWTXhtmlReplacedElementFactory(this)); if (Configuration.isTrue("xr.use.listeners", true)) { new HoverListener(this); new CursorListener(this); new LinkListener(this); } }
/** * Renders a Document read from an InputStream using a URL as a base URL for * relative paths. * * @param file The file to read the Document from. Relative paths will be * resolved based on the file's parent directory. * @throws MalformedURLException */ public void setDocument(File file) throws MalformedURLException { File parent = file.getParentFile(); String parentURL = (parent == null ? "" : parent.toURI().toURL() .toExternalForm()); setDocument(loadDocument(file.toURI().toURL().toExternalForm()), parentURL); }
public SWTXHTMLRenderer(Composite parent, int style, UserAgentCallback uac) { super(parent, style, uac); init(); }