for (Item item : stylesheets) { File file = new File(item.getFile()); Stylesheet css = new Stylesheet(file); builder.addCssStylesheet(css);
builderStylesheet = new HtmlDocumentBuilder.Stylesheet(stylesheet.url); } else { builderStylesheet = new HtmlDocumentBuilder.Stylesheet(stylesheet.file); builderStylesheet.getAttributes().put(attr.getKey(), attr.getValue());
/** * Add a CSS stylesheet to the output document, where the contents of the CSS stylesheet are embedded in the HTML. * Calling this method after {@link #beginDocument() starting the document} has no effect. Generates code similar to * the following: * * <pre> * <code> * <style type="text/css"> * ... contents of the file ... * </style> * </code> * </pre> * * @param file * the CSS file whose contents must be available * @return the stylesheet, whose attributes may be modified * @see #addCssStylesheet(String) * @deprecated use {@link #addCssStylesheet(Stylesheet)} instead */ @Deprecated public void addCssStylesheet(File file) { addCssStylesheet(new Stylesheet(file)); }
/** * Add a CSS stylesheet to the output document as an URL, where the CSS stylesheet is referenced as an HTML link. * Calling this method after {@link #beginDocument() starting the document} has no effect. Generates code similar to * the following: <code> * <link type="text/css" rel="stylesheet" href="url"/> * </code> * * @param url * the CSS url to use, which may be relative or absolute * @return the stylesheet, whose attributes may be modified * @see #addCssStylesheet(File) * @deprecated use {@link #addCssStylesheet(Stylesheet)} instead */ @Deprecated public void addCssStylesheet(String url) { addCssStylesheet(new Stylesheet(url)); }