當前位置: 首頁>>代碼示例>>Java>>正文


Java Traversal.listTraversal方法代碼示例

本文整理匯總了Java中cz.vutbr.web.domassign.Traversal.listTraversal方法的典型用法代碼示例。如果您正苦於以下問題:Java Traversal.listTraversal方法的具體用法?Java Traversal.listTraversal怎麽用?Java Traversal.listTraversal使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在cz.vutbr.web.domassign.Traversal的用法示例。


在下文中一共展示了Traversal.listTraversal方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: assignDOM

import cz.vutbr.web.domassign.Traversal; //導入方法依賴的package包/類
/**
 * Goes through a DOM tree and assigns the CSS declarations to the DOM elements.
 * 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>   
 * 
 * @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 useInheritance
 *            Whether inheritance will be used to determine values
 * @return Map between DOM element nodes and data structure containing CSS
 *         information
 */
public static final StyleMap assignDOM(Document doc, String encoding,
		URL base, String media, boolean useInheritance) {

	Pair pair = new Pair(base, media);

	Traversal<StyleSheet> traversal = new CSSAssignTraversal(doc, encoding,
			(Object) pair, NodeFilter.SHOW_ELEMENT);

	StyleSheet style = (StyleSheet) getRuleFactory().createStyleSheet()
			.unlock();
	traversal.listTraversal(style);

	Analyzer analyzer = new Analyzer(style);
	return analyzer.evaluateDOM(doc, media, useInheritance);
}
 
開發者ID:mantlik,項目名稱:swingbox-javahelp-viewer,代碼行數:40,代碼來源:CSSFactory.java

示例2: assignDOM

import cz.vutbr.web.domassign.Traversal; //導入方法依賴的package包/類
/**
 * This is the same as {@link CSSFactory#assignDOM(Document, String, URL, MediaSpec, boolean)} 
 * with the possibility of specifying a custom network processor for obtaining data from URL
 * resources.
 * 
 * @param doc
 *            DOM tree
 * @param encoding
 *            The default encoding used for the referenced style sheets
 * @param network
 *            Custom network processor
 * @param base
 *            Base URL against which all files are searched
 * @param media
 *            Current media specification used for evaluating the media queries
 * @param useInheritance
 *            Whether inheritance will be used to determine values
 * @param matchCond
 *            The match condition to match the against.
 * @return Map between DOM element nodes and data structure containing CSS
 *         information
 */ 
public static final StyleMap assignDOM(Document doc, String encoding, NetworkProcessor network,
        URL base, MediaSpec media, boolean useInheritance, final MatchCondition matchCond) {

    SourceData pair = new SourceData(base, network, media);

    Traversal<StyleSheet> traversal = new CSSAssignTraversal(doc, encoding,
            pair, NodeFilter.SHOW_ELEMENT);

    StyleSheet style = (StyleSheet) getRuleFactory().createStyleSheet()
            .unlock();
    traversal.listTraversal(style);

    Analyzer analyzer = new Analyzer(style);
    if (matchCond != null) {
        analyzer.registerMatchCondition(matchCond);
    }
    return analyzer.evaluateDOM(doc, media, useInheritance);
}
 
開發者ID:radkovo,項目名稱:jStyleParser,代碼行數:41,代碼來源:CSSFactory.java

示例3: getUsedStyles

import cz.vutbr.web.domassign.Traversal; //導入方法依賴的package包/類
/**
 * 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>   
 * 
 * @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)
{
    Pair pair = new Pair(base, media);

    Traversal<StyleSheet> traversal = new CSSAssignTraversal(doc, encoding,
            (Object) pair, NodeFilter.SHOW_ELEMENT);

    StyleSheet style = (StyleSheet) getRuleFactory().createStyleSheet().unlock();
    traversal.listTraversal(style);
    return style;
}
 
開發者ID:mantlik,項目名稱:swingbox-javahelp-viewer,代碼行數:33,代碼來源:CSSFactory.java

示例4: getUsedStyles

import cz.vutbr.web.domassign.Traversal; //導入方法依賴的package包/類
/**
 * 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>
 *
 * @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(XmlDocument doc, String encoding, URL base, MediaSpec media) {
    Pair pair = new Pair(base, media);

    Traversal<StyleSheet> traversal = new CSSAssignTraversal(doc, encoding, (Object) pair);

    StyleSheet style = (StyleSheet) getRuleFactory().createStyleSheet().unlock();
    traversal.listTraversal(style);
    return style;
}
 
開發者ID:chrimm,項目名稱:cordovastudio,代碼行數:27,代碼來源:CSSFactory.java

示例5: assignDOM

import cz.vutbr.web.domassign.Traversal; //導入方法依賴的package包/類
/**
 * Goes through a DOM tree and assigns the CSS declarations to the DOM elements.
 * 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>
 *
 * @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          Current media specification used for evaluating the media queries
 * @param useInheritance Whether inheritance will be used to determine values
 * @return Map between DOM element nodes and data structure containing CSS
 * information
 */
public static final StyleMap assignDOM(XmlDocument doc, String encoding,
                                       URL base, MediaSpec media, boolean useInheritance) {

    Pair pair = new Pair(base, media);

    Traversal<StyleSheet> traversal = new CSSAssignTraversal(doc, encoding, (Object) pair);

    StyleSheet style = (StyleSheet) getRuleFactory().createStyleSheet()
            .unlock();
    traversal.listTraversal(style);

    Analyzer analyzer = new Analyzer(style);
    return analyzer.evaluateDOM(doc, media, useInheritance);
}
 
開發者ID:chrimm,項目名稱:cordovastudio,代碼行數:34,代碼來源:CSSFactory.java

示例6: getUsedStyles

import cz.vutbr.web.domassign.Traversal; //導入方法依賴的package包/類
/**
 * 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>   
 * 
 * @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, NetworkProcessor network)
{
    SourceData pair = new SourceData(base, network, media);

    Traversal<StyleSheet> traversal = new CSSAssignTraversal(doc, encoding,
            pair, NodeFilter.SHOW_ELEMENT);

    StyleSheet style = (StyleSheet) getRuleFactory().createStyleSheet().unlock();
    traversal.listTraversal(style);
    return style;
}
 
開發者ID:radkovo,項目名稱:jStyleParser,代碼行數:33,代碼來源:CSSFactory.java


注:本文中的cz.vutbr.web.domassign.Traversal.listTraversal方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。