/** * Loads all the style sheets used from the specified DOM tree. * The following style specifications are evaluated: * <ul> * <li>The style sheets included using the <code>link</code> and <code>style</code> tags. * <li>Inline styles specified using the <code>style</code> element attribute. * <li><strong>Proprietary extension:</strong> Default styles defined using the <code>XDefaultStyle</code> * element attribute. These styles behave the same way as the inline styles but they have the lowest priority * (the values are used only when not redefined by any other way) * </ul> * <b>This method does not allow specifying the default style sheet character encoding. The current system * encoding is used by default. It is recommended to use the {@link #getUsedStyles(Document, String, URL, String)} * method in order to specify the encoding correctly.</b> * * @param doc * DOM tree * @param base * Base URL against which all files are searched * @param media * Selected media for style sheet * @return the rules of all the style sheets used in the document including the inline styles */ public static final StyleSheet getUsedStyles(Document doc, URL base, String media) { return getUsedStyles(doc, null, base, media); }
@Deprecated public static final StyleSheet getUsedStyles(Document doc, URL base, String media) { return getUsedStyles(doc, null, base, media); }
@Deprecated public static final StyleSheet getUsedStyles(Document doc, URL base, String media) { return getUsedStyles(doc, null, base, media); }
@Deprecated public static final StyleSheet getUsedStyles(Document doc, URL base, String media) { return getUsedStyles(doc, null, base, media); }
/** * This is the same as {@link CSSFactory#getUsedStyles(Document, String, URL, MediaSpec)} with * the possibility of specifying a custom network processor. * * @param doc * DOM tree * @param encoding * The default encoding used for the referenced style sheets * @param base * Base URL against which all files are searched * @param media * Selected media for style sheet * @param network * The network processor used for accessing the URL resources * @return the rules of all the style sheets used in the document including the inline styles */ public static final StyleSheet getUsedStyles(Document doc, String encoding, URL base, MediaSpec media) { return getUsedStyles(doc, encoding, base, media, new DefaultNetworkProcessor()); }
/** * This is the same as {@link CSSFactory#getUsedStyles(Document, String, URL, MediaSpec)} with * the possibility of specifying a custom network processor. * * @param doc * DOM tree * @param encoding * The default encoding used for the referenced style sheets * @param base * Base URL against which all files are searched * @param media * Selected media for style sheet * @return the rules of all the style sheets used in the document including the inline styles */ public static final StyleSheet getUsedStyles(Document doc, String encoding, URL base, MediaSpec media) { return getUsedStyles(doc, encoding, base, media, getNetworkProcessor()); }
/** * This is the same as {@link CSSFactory#getUsedStyles(Document, String, URL, MediaSpec)} with * the possibility of specifying a custom network processor. * * @param doc * DOM tree * @param encoding * The default encoding used for the referenced style sheets * @param base * Base URL against which all files are searched * @param media * Selected media for style sheet * @return the rules of all the style sheets used in the document including the inline styles */ public static final StyleSheet getUsedStyles(Document doc, String encoding, URL base, MediaSpec media) { return getUsedStyles(doc, encoding, base, media, getNetworkProcessor()); }
/** * This is the same as {@link CSSFactory#getUsedStyles(Document, String, URL, MediaSpec)} but only the * media type is provided instead of the complete media specification. * * @param doc * DOM tree * @param encoding * The default encoding used for the referenced style sheets * @param base * Base URL against which all files are searched * @param media * Selected media for style sheet * @return the rules of all the style sheets used in the document including the inline styles */ public static final StyleSheet getUsedStyles(Document doc, String encoding, URL base, String media) { return getUsedStyles(doc, encoding, base, new MediaSpec(media), getNetworkProcessor()); }
/** * This is the same as {@link CSSFactory#getUsedStyles(Document, String, URL, MediaSpec)} but only the * media type is provided instead of the complete media specification. * * @param doc * DOM tree * @param encoding * The default encoding used for the referenced style sheets * @param base * Base URL against which all files are searched * @param media * Selected media for style sheet * @return the rules of all the style sheets used in the document including the inline styles */ public static final StyleSheet getUsedStyles(Document doc, String encoding, URL base, String media) { return getUsedStyles(doc, encoding, base, new MediaSpec(media), new DefaultNetworkProcessor()); }
/** * This is the same as {@link CSSFactory#getUsedStyles(Document, String, URL, MediaSpec)} but only the * media type is provided instead of the complete media specification. * * @param doc * DOM tree * @param encoding * The default encoding used for the referenced style sheets * @param base * Base URL against which all files are searched * @param media * Selected media for style sheet * @return the rules of all the style sheets used in the document including the inline styles */ public static final StyleSheet getUsedStyles(Document doc, String encoding, URL base, String media) { return getUsedStyles(doc, encoding, base, new MediaSpec(media), getNetworkProcessor()); }
/** * This is the same as {@link CSSFactory#getUsedStyles(Document, String, URL, MediaSpec, NetworkProcessor, Stylesheet)} * but a new StyleSheet is created instead of appending to one. * * @param doc * DOM tree * @param encoding * The default encoding used for the referenced style sheets * @param base * Base URL against which all files are searched * @param media * Selected media for style sheet * @param network * The network processor used for accessing the URL resources * @return the rules of all the style sheets used in the document including the inline styles */ public static final StyleSheet getUsedStyles(Document doc, String encoding, URL base, MediaSpec media, NetworkProcessor network) { StyleSheet style = (StyleSheet) getRuleFactory().createStyleSheet().unlock(); return getUsedStyles(doc, encoding, base, media, network, style); }
stylesheet = CSSFactory.getUsedStyles(document, null, baseURL, new MediaSpec(medium), network, stylesheet); stylesheet = CSSFactory.getUsedStyles(document, null, baseURL, new MediaSpec(medium), network, stylesheet);