• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SACMediaList类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.w3c.css.sac.SACMediaList的典型用法代码示例。如果您正苦于以下问题:Java SACMediaList类的具体用法?Java SACMediaList怎么用?Java SACMediaList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SACMediaList类属于org.w3c.css.sac包,在下文中一共展示了SACMediaList类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: mediaMatch

import org.w3c.css.sac.SACMediaList; //导入依赖的package包/类
/**
 * Whether the given media list matches the media list of this
 * CSSEngine object.
 */
protected boolean mediaMatch(SACMediaList ml) {
if (media == null ||
        ml == null ||
        media.getLength() == 0 ||
        ml.getLength() == 0) {
    return true;
}
for (int i = 0; i < ml.getLength(); i++) {
        if (ml.item(i).equalsIgnoreCase("all"))
            return true;
    for (int j = 0; j < media.getLength(); j++) {
    if (media.item(j).equalsIgnoreCase("all") ||
                ml.item(i).equalsIgnoreCase(media.item(j))) {
        return true;
    }
    }
}
return false;
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:24,代码来源:CSSEngine.java


示例2: importStyle

import org.w3c.css.sac.SACMediaList; //导入依赖的package包/类
/**
 * <b>SAC</b>: Implements {@link
 * DocumentHandler#importStyle(String,SACMediaList,String)}.
 */
public void importStyle(String       uri,
                        SACMediaList media,
                        String       defaultNamespaceURI)
    throws CSSException {
    ImportRule ir = new ImportRule();
    ir.setMediaList(media);
    ir.setParent(styleSheet);
    ParsedURL base = getCSSBaseURI();
    ParsedURL url;
    if (base == null) {
        url = new ParsedURL(uri);
    } else {
        url = new ParsedURL(base, uri);
    }
    ir.setURI(url);
    styleSheet.append(ir);
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:22,代码来源:CSSEngine.java


示例3: startMedia

import org.w3c.css.sac.SACMediaList; //导入依赖的package包/类
@Override
public void startMedia(final SACMediaList media, final Locator locator) throws CSSException {
	final MediaListImpl ml = new MediaListImpl(media);
	// Create the media rule and add it to the rule list
	final CSSMediaRuleImpl mr = new CSSMediaRuleImpl(CSSOMParser.this.getParentStyleSheet(), getParentRule(),
			ml);
	addLocator(locator, mr);
	if (!nodeStack_.empty()) {
		((CSSRuleListImpl) nodeStack_.peek()).add(mr);
	}

	// Create the rule list
	final CSSRuleListImpl rules = new CSSRuleListImpl();
	mr.setRuleList(rules);
	nodeStack_.push(mr);
	nodeStack_.push(rules);
}
 
开发者ID:oswetto,项目名称:LoboEvolution,代码行数:18,代码来源:CSSOMParser.java


示例4: startMedia

import org.w3c.css.sac.SACMediaList; //导入依赖的package包/类
@Override
	public void startMedia(SACMediaList mediaList) throws CSSException {
//		if (currentMediaQueryList == null) {
//			currentMediaQueryList = getMedia(mediaList);
//		} else {
//			MediaQueryList groupedMedia;
//			if (currentMediaQueryList instanceof MediaQuery) {
//				groupedMedia = new MediaQueryList();
//				groupedMedia.addMedia((MediaQuery) currentMediaQueryList);
//			} else {
//				groupedMedia = (MediaQueryList)currentMediaQueryList;
//			}
//			Media tempMedia = getMedia(mediaList);
//			if (tempMedia instanceof MediaQuery)
//				groupedMedia.addMedia((MediaQuery)tempMedia);
//			else 
//				groupedMedia.addAllMedia((MediaQueryList)tempMedia);
//			currentMediaQueryList = groupedMedia;
//		}	
	}
 
开发者ID:dmazinanian,项目名称:css-analyser,代码行数:21,代码来源:CSSDocumentHandler.java


示例5: parseMedia

import org.w3c.css.sac.SACMediaList; //导入依赖的package包/类
/**
 * Implements {@link ExtendedParser#parseMedia(String)}.
 */
public SACMediaList parseMedia(String mediaText)
    throws CSSException, IOException {
    CSSSACMediaList result = new CSSSACMediaList();
    if (!"all".equalsIgnoreCase(mediaText)) {
        StringTokenizer st = new StringTokenizer(mediaText, " ,");
        while (st.hasMoreTokens()) {
            result.append(st.nextToken());
        }
    }
    return result;
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:15,代码来源:ExtendedParserWrapper.java


示例6: startMedia

import org.w3c.css.sac.SACMediaList; //导入依赖的package包/类
/**
 * <b>SAC</b>: Implements {@link
 * org.w3c.css.sac.DocumentHandler#startMedia(SACMediaList)}.
 */
public void startMedia(SACMediaList media) throws CSSException {
    MediaRule mr = new MediaRule();
    mr.setMediaList(media);
    mr.setParent(styleSheet);
    styleSheet.append(mr);
    styleSheet = mr;
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:12,代码来源:CSSEngine.java


示例7: handleImportStyle

import org.w3c.css.sac.SACMediaList; //导入依赖的package包/类
protected void handleImportStyle(final String uri, final SACMediaList media, final String defaultNamespaceURI,
		final Locator locator) {
	final DocumentHandler documentHandler = getDocumentHandler();
	if (documentHandler instanceof DocumentHandlerExt) {
		((DocumentHandlerExt) documentHandler).importStyle(uri, media, defaultNamespaceURI, locator);
	} else {
		documentHandler.importStyle(uri, media, defaultNamespaceURI);
	}
}
 
开发者ID:oswetto,项目名称:LoboEvolution,代码行数:10,代码来源:AbstractSACParser.java


示例8: handleStartMedia

import org.w3c.css.sac.SACMediaList; //导入依赖的package包/类
protected void handleStartMedia(final SACMediaList media, final Locator locator) {
	final DocumentHandler documentHandler = getDocumentHandler();
	if (documentHandler instanceof DocumentHandlerExt) {
		((DocumentHandlerExt) documentHandler).startMedia(media, locator);
	} else {
		documentHandler.startMedia(media);
	}
}
 
开发者ID:oswetto,项目名称:LoboEvolution,代码行数:9,代码来源:AbstractSACParser.java


示例9: parseMedia

import org.w3c.css.sac.SACMediaList; //导入依赖的package包/类
public SACMediaList parseMedia(final InputSource source) throws IOException {
	final HandlerBase handler = new HandlerBase();
	parser_.setDocumentHandler(handler);
	if (parser_ instanceof AbstractSACParser) {
		return ((AbstractSACParser) parser_).parseMedia(source);
	}
	return null;
}
 
开发者ID:oswetto,项目名称:LoboEvolution,代码行数:9,代码来源:CSSOMParser.java


示例10: importStyle

import org.w3c.css.sac.SACMediaList; //导入依赖的package包/类
@Override
public void importStyle(final String uri, final SACMediaList media, final String defaultNamespaceURI,
		final Locator locator) throws CSSException {
	// Create the import rule and add it to the rule list
	final CSSImportRuleImpl ir = new CSSImportRuleImpl(CSSOMParser.this.getParentStyleSheet(), getParentRule(),
			uri, new MediaListImpl(media));
	addLocator(locator, ir);
	if (!nodeStack_.empty()) {
		((CSSRuleListImpl) nodeStack_.peek()).add(ir);
	} else {
		root_ = ir;
	}
}
 
开发者ID:oswetto,项目名称:LoboEvolution,代码行数:14,代码来源:CSSOMParser.java


示例11: setMediaText

import org.w3c.css.sac.SACMediaList; //导入依赖的package包/类
public void setMediaText(final String mediaText) {
	final InputSource source = new InputSource(new StringReader(mediaText));
	try {
		final CSSOMParser parser = new CSSOMParser();
		final SACMediaList sml = parser.parseMedia(source);
		media_ = new MediaListImpl(sml);
	} catch (final IOException e) {
		// TODO handle exception
	}
}
 
开发者ID:oswetto,项目名称:LoboEvolution,代码行数:11,代码来源:CSSStyleSheetImpl.java


示例12: MediaListImpl

import org.w3c.css.sac.SACMediaList; //导入依赖的package包/类
/**
 * Creates new MediaList.
 * 
 * @param mediaList
 *            the media list
 */
public MediaListImpl(final SACMediaList mediaList) {
	this();

	setMediaList(mediaList);

	if (mediaList instanceof Locatable) {
		final Locator locator = ((Locatable) mediaList).getLocator();
		if (locator != null) {
			setUserData(UserDataConstants.KEY_LOCATOR, locator);
		}
	}
}
 
开发者ID:oswetto,项目名称:LoboEvolution,代码行数:19,代码来源:MediaListImpl.java


示例13: setMediaList

import org.w3c.css.sac.SACMediaList; //导入依赖的package包/类
private void setMediaList(final SACMediaList mediaList) {
	if (mediaList instanceof SACMediaListImpl) {
		final SACMediaListImpl impl = (SACMediaListImpl) mediaList;
		for (int i = 0; i < mediaList.getLength(); i++) {
			mediaQueries_.add(impl.mediaQuery(i));
		}
		return;
	}

	for (int i = 0; i < mediaList.getLength(); i++) {
		mediaQueries_.add(new MediaQuery(mediaList.item(i)));
	}
}
 
开发者ID:oswetto,项目名称:LoboEvolution,代码行数:14,代码来源:MediaListImpl.java


示例14: endMedia

import org.w3c.css.sac.SACMediaList; //导入依赖的package包/类
@Override
	public void endMedia(SACMediaList mediaList) throws CSSException {
//		if (currentMediaQueryList instanceof MediaQuery) {
//			currentMediaQueryList = null;
//		} else {
//			MediaQueryList groupedMedia = (MediaQueryList)currentMediaQueryList;
//			for (int i = 0; i < mediaList.getLength(); i++) {
//				groupedMedia.removeMedia(mediaList.item(i));
//			}
//			if (groupedMedia.size() == 1)
//				currentMediaQueryList = new MediaQuery(groupedMedia.getAtomicMedia(0).getMediaType());
//			else if (groupedMedia.size() == 0)
//				currentMediaQueryList = null;
//		}
	}
 
开发者ID:dmazinanian,项目名称:css-analyser,代码行数:16,代码来源:CSSDocumentHandler.java


示例15: endMedia

import org.w3c.css.sac.SACMediaList; //导入依赖的package包/类
@Override
public void endMedia(SACMediaList arg0) throws CSSException {
	// TODO Auto-generated method stub

}
 
开发者ID:eclipse,项目名称:tm4e,代码行数:6,代码来源:CSSDocumentHandler.java


示例16: importStyle

import org.w3c.css.sac.SACMediaList; //导入依赖的package包/类
@Override
public void importStyle(String arg0, SACMediaList arg1, String arg2) throws CSSException {
	// TODO Auto-generated method stub

}
 
开发者ID:eclipse,项目名称:tm4e,代码行数:6,代码来源:CSSDocumentHandler.java


示例17: startMedia

import org.w3c.css.sac.SACMediaList; //导入依赖的package包/类
@Override
public void startMedia(SACMediaList arg0) throws CSSException {
	// TODO Auto-generated method stub

}
 
开发者ID:eclipse,项目名称:tm4e,代码行数:6,代码来源:CSSDocumentHandler.java


示例18: importStyle

import org.w3c.css.sac.SACMediaList; //导入依赖的package包/类
/**
 * <b>SAC</b>: Implements {@link
 * DocumentHandler#importStyle(String,SACMediaList,String)}.
 */
public void importStyle(String       uri,
                        SACMediaList media,
                        String       defaultNamespaceURI)
    throws CSSException {
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:10,代码来源:DefaultDocumentHandler.java


示例19: setMedia

import org.w3c.css.sac.SACMediaList; //导入依赖的package包/类
/**
 * Sets the media to use to compute the styles.
 */
public void setMedia(SACMediaList m) {
    media = m;
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:7,代码来源:StyleSheet.java


示例20: getMedia

import org.w3c.css.sac.SACMediaList; //导入依赖的package包/类
/**
 * Returns the media to use to compute the styles.
 */
public SACMediaList getMedia() {
    return media;
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:7,代码来源:StyleSheet.java



注:本文中的org.w3c.css.sac.SACMediaList类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PersistenceProviderImpl类代码示例发布时间:2022-05-22
下一篇:
Java ByteArrayISO8859Writer类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap