本文整理汇总了Java中org.w3c.css.sac.SelectorList类的典型用法代码示例。如果您正苦于以下问题:Java SelectorList类的具体用法?Java SelectorList怎么用?Java SelectorList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SelectorList类属于org.w3c.css.sac包,在下文中一共展示了SelectorList类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getBestStyle
import org.w3c.css.sac.SelectorList; //导入依赖的package包/类
public IStyle getBestStyle(String... names) {
int bestSpecificity = 0;
IStyle bestStyle = null;
for (IStyle style : handler.getList()) {
SelectorList list = ((CSSStyle) style).getSelectorList();
for (int i = 0; i < list.getLength(); i++) {
Selector selector = list.item(i);
if (selector instanceof ExtendedSelector) {
ExtendedSelector s = ((ExtendedSelector) selector);
int nbMatch = s.nbMatch(names);
if (nbMatch > 0 && nbMatch == s.nbClass()) {
if (bestStyle == null || (nbMatch >= bestSpecificity)) {
bestStyle = style;
bestSpecificity = nbMatch;
}
}
}
}
}
return bestStyle;
}
开发者ID:eclipse,项目名称:tm4e,代码行数:22,代码来源:CSSParser.java
示例2: findSelectorAttributes
import org.w3c.css.sac.SelectorList; //导入依赖的package包/类
/**
* Finds the selector attributes in the given stylesheet.
*/
protected void findSelectorAttributes(Set attrs, StyleSheet ss) {
int len = ss.getSize();
for (int i = 0; i < len; i++) {
Rule r = ss.getRule(i);
switch (r.getType()) {
case StyleRule.TYPE:
StyleRule style = (StyleRule)r;
SelectorList sl = style.getSelectorList();
int slen = sl.getLength();
for (int j = 0; j < slen; j++) {
ExtendedSelector s = (ExtendedSelector)sl.item(j);
s.fillAttributeSet(attrs);
}
break;
case MediaRule.TYPE:
case ImportRule.TYPE:
MediaRule mr = (MediaRule)r;
if (mediaMatch(mr.getMediaList())) {
findSelectorAttributes(attrs, mr);
}
break;
}
}
}
开发者ID:git-moss,项目名称:Push2Display,代码行数:29,代码来源:CSSEngine.java
示例3: parseSelectorsInternal
import org.w3c.css.sac.SelectorList; //导入依赖的package包/类
@Override
final public SelectorList parseSelectorsInternal() throws ParseException {
SelectorList selectors;
label_12: while (true) {
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case S: {
;
break;
}
default:
jj_la1[19] = jj_gen;
break label_12;
}
jj_consume_token(S);
}
selectors = selectorList();
jj_consume_token(0);
return selectors;
}
开发者ID:oswetto,项目名称:LoboEvolution,代码行数:20,代码来源:SACParserCSS1.java
示例4: parseSelectorsInternal
import org.w3c.css.sac.SelectorList; //导入依赖的package包/类
@Override
final public SelectorList parseSelectorsInternal() throws ParseException {
SelectorList selectors;
label_26: while (true) {
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case S: {
;
break;
}
default:
jj_la1[43] = jj_gen;
break label_26;
}
jj_consume_token(S);
}
selectors = selectorList();
jj_consume_token(0);
return selectors;
}
开发者ID:oswetto,项目名称:LoboEvolution,代码行数:20,代码来源:SACParserCSS21.java
示例5: parseSelectorsInternal
import org.w3c.css.sac.SelectorList; //导入依赖的package包/类
@Override
final public SelectorList parseSelectorsInternal() throws ParseException {
SelectorList selectors;
label_40: while (true) {
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case S: {
;
break;
}
default:
jj_la1[62] = jj_gen;
break label_40;
}
jj_consume_token(S);
}
selectors = selectorList();
jj_consume_token(0);
return selectors;
}
开发者ID:oswetto,项目名称:LoboEvolution,代码行数:20,代码来源:SACParserCSS3.java
示例6: parseSelectorsInternal
import org.w3c.css.sac.SelectorList; //导入依赖的package包/类
@Override
final public SelectorList parseSelectorsInternal() throws ParseException {
SelectorList selectors;
label_20: while (true) {
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case S: {
;
break;
}
default:
jj_la1[31] = jj_gen;
break label_20;
}
jj_consume_token(S);
}
selectors = selectorList();
jj_consume_token(0);
return selectors;
}
开发者ID:oswetto,项目名称:LoboEvolution,代码行数:20,代码来源:SACParserCSSmobileOKBasic1.java
示例7: parseSelectorsInternal
import org.w3c.css.sac.SelectorList; //导入依赖的package包/类
@Override
final public SelectorList parseSelectorsInternal() throws ParseException {
SelectorList selectors;
label_35: while (true) {
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case S: {
;
break;
}
default:
jj_la1[56] = jj_gen;
break label_35;
}
jj_consume_token(S);
}
selectors = selectorList();
jj_consume_token(0);
return selectors;
}
开发者ID:oswetto,项目名称:LoboEvolution,代码行数:20,代码来源:SACParserCSS2.java
示例8: startSelector
import org.w3c.css.sac.SelectorList; //导入依赖的package包/类
@Override
public void startSelector(final SelectorList selectors, final Locator locator) throws CSSException {
// Create the style rule and add it to the rule list
final CSSStyleRuleImpl sr = new CSSStyleRuleImpl(CSSOMParser.this.getParentStyleSheet(), getParentRule(),
selectors);
addLocator(locator, sr);
if (!nodeStack_.empty()) {
final Object o = nodeStack_.peek();
((CSSRuleListImpl) o).add(sr);
}
// Create the style declaration
final CSSStyleDeclarationImpl decl = new CSSStyleDeclarationImpl(sr);
sr.setStyle(decl);
nodeStack_.push(sr);
nodeStack_.push(decl);
}
开发者ID:oswetto,项目名称:LoboEvolution,代码行数:18,代码来源:CSSOMParser.java
示例9: startSelector
import org.w3c.css.sac.SelectorList; //导入依赖的package包/类
public void startSelector( SelectorList selectors ) throws CSSException
{
// Create the style rule and add it to the rule list
StyleRule sr = new StyleRule( selectors );
if ( !nodeStack.empty( ) )
{
( (StyleSheet) nodeStack.peek( ) ).add( sr );
}
// Create the style declaration
StyleDeclaration decl = new StyleDeclaration( );
sr.setStyle( decl );
nodeStack.push( sr );
nodeStack.push( decl );
}
开发者ID:eclipse,项目名称:birt,代码行数:17,代码来源:CssParser.java
示例10: _parseSelectors
import org.w3c.css.sac.SelectorList; //导入依赖的package包/类
final public SelectorList _parseSelectors() throws ParseException {
SelectorList p = null;
try {
label_81:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case S:
;
break;
default:
jj_la1[124] = jj_gen;
break label_81;
}
jj_consume_token(S);
}
p = selectorList();
{if (true) return p;}
} catch (ThrowedParseException e) {
{if (true) throw (ParseException) e.e.fillInStackTrace();}
}
throw new Error("Missing return statement in function");
}
开发者ID:dmazinanian,项目名称:css-analyser,代码行数:23,代码来源:Parser.java
示例11: parseSelectorsInternal
import org.w3c.css.sac.SelectorList; //导入依赖的package包/类
/**
* Parses selectors using the current scanner.
*/
protected SelectorList parseSelectorsInternal()
throws CSSException, IOException {
nextIgnoreSpaces();
SelectorList ret = parseSelectorList();
scanner.close();
scanner = null;
return ret;
}
开发者ID:git-moss,项目名称:Push2Display,代码行数:12,代码来源:Parser.java
示例12: parseSelectorList
import org.w3c.css.sac.SelectorList; //导入依赖的package包/类
/**
* Parses a selector list
*/
protected SelectorList parseSelectorList() {
CSSSelectorList result = new CSSSelectorList();
result.append(parseSelector());
for (;;) {
if (current != LexicalUnits.COMMA) {
return result;
}
nextIgnoreSpaces();
result.append(parseSelector());
}
}
开发者ID:git-moss,项目名称:Push2Display,代码行数:16,代码来源:Parser.java
示例13: addMatchingRules
import org.w3c.css.sac.SelectorList; //导入依赖的package包/类
/**
* Adds the rules matching the element/pseudo-element of given style
* sheet to the list.
*/
protected void addMatchingRules(List rules,
StyleSheet ss,
Element elt,
String pseudo) {
int len = ss.getSize();
for (int i = 0; i < len; i++) {
Rule r = ss.getRule(i);
switch (r.getType()) {
case StyleRule.TYPE:
StyleRule style = (StyleRule)r;
SelectorList sl = style.getSelectorList();
int slen = sl.getLength();
for (int j = 0; j < slen; j++) {
ExtendedSelector s = (ExtendedSelector)sl.item(j);
if (s.match(elt, pseudo)) {
rules.add(style);
}
}
break;
case MediaRule.TYPE:
case ImportRule.TYPE:
MediaRule mr = (MediaRule)r;
if (mediaMatch(mr.getMediaList())) {
addMatchingRules(rules, mr, elt, pseudo);
}
break;
}
}
}
开发者ID:git-moss,项目名称:Push2Display,代码行数:35,代码来源:CSSEngine.java
示例14: startSelector
import org.w3c.css.sac.SelectorList; //导入依赖的package包/类
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.DocumentHandler#startSelector(SelectorList)}.
*/
public void startSelector(SelectorList selectors) throws CSSException {
styleRule = new StyleRule();
styleRule.setSelectorList(selectors);
styleDeclaration = new StyleDeclaration();
styleRule.setStyleDeclaration(styleDeclaration);
styleSheet.append(styleRule);
}
开发者ID:git-moss,项目名称:Push2Display,代码行数:12,代码来源:CSSEngine.java
示例15: findRule
import org.w3c.css.sac.SelectorList; //导入依赖的package包/类
protected CSSStyleRule findRule(CSSRuleList rules, String ruleName) throws Exception {
for (int i = 0; i < rules.getLength(); i++) {
CSSStyleRuleImpl rule = (CSSStyleRuleImpl) rules.item(i);
SelectorList selectorList = rule.getSelectors();
for (int s = 0; s < selectorList.getLength(); s++ ) {
Selector selector = selectorList.item(s);
if (selector.toString().equals(ruleName)) {
return rule;
}
}
}
return null;
}
开发者ID:NineWorlds,项目名称:xstreamer,代码行数:15,代码来源:XWIngCommonCssTest.java
示例16: parseSelectorsInternal
import org.w3c.css.sac.SelectorList; //导入依赖的package包/类
/**
* Parses selectors using the current scanner.
*/
protected SelectorList parseSelectorsInternal()
throws CSSException, IOException {
nextIgnoreSpaces();
SelectorList ret = parseSelectorList();
scanner = null;
return ret;
}
开发者ID:BowlerHatLLC,项目名称:feathers-sdk,代码行数:11,代码来源:Parser.java
示例17: handleStartSelector
import org.w3c.css.sac.SelectorList; //导入依赖的package包/类
protected void handleStartSelector(final SelectorList selectors, final Locator locator) {
final DocumentHandler documentHandler = getDocumentHandler();
if (documentHandler instanceof DocumentHandlerExt) {
((DocumentHandlerExt) documentHandler).startSelector(selectors, locator);
} else {
documentHandler.startSelector(selectors);
}
}
开发者ID:oswetto,项目名称:LoboEvolution,代码行数:9,代码来源:AbstractSACParser.java
示例18: selectorList
import org.w3c.css.sac.SelectorList; //导入依赖的package包/类
@Override
final public SelectorList selectorList() throws ParseException {
SelectorListImpl selList = new SelectorListImpl();
Selector sel;
sel = selector();
if (sel instanceof Locatable) {
selList.setLocator(((Locatable) sel).getLocator());
}
label_27: while (true) {
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case COMMA: {
;
break;
}
default:
jj_la1[44] = jj_gen;
break label_27;
}
jj_consume_token(COMMA);
label_28: while (true) {
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case S: {
;
break;
}
default:
jj_la1[45] = jj_gen;
break label_28;
}
jj_consume_token(S);
}
selList.add(sel);
sel = selector();
}
selList.add(sel);
return selList;
}
开发者ID:oswetto,项目名称:LoboEvolution,代码行数:38,代码来源:SACParserCSS21.java
示例19: selectorList
import org.w3c.css.sac.SelectorList; //导入依赖的package包/类
@Override
final public SelectorList selectorList() throws ParseException {
SelectorListImpl selList = new SelectorListImpl();
Selector sel;
sel = selector();
if (sel instanceof Locatable) {
selList.setLocator(((Locatable) sel).getLocator());
}
label_41: while (true) {
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case COMMA: {
;
break;
}
default:
jj_la1[63] = jj_gen;
break label_41;
}
jj_consume_token(COMMA);
label_42: while (true) {
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case S: {
;
break;
}
default:
jj_la1[64] = jj_gen;
break label_42;
}
jj_consume_token(S);
}
selList.add(sel);
sel = selector();
}
selList.add(sel);
return selList;
}
开发者ID:oswetto,项目名称:LoboEvolution,代码行数:38,代码来源:SACParserCSS3.java
示例20: selectorList
import org.w3c.css.sac.SelectorList; //导入依赖的package包/类
@Override
final public SelectorList selectorList() throws ParseException {
SelectorListImpl selList = new SelectorListImpl();
Selector sel;
sel = selector();
if (sel instanceof Locatable) {
selList.setLocator(((Locatable) sel).getLocator());
}
label_36: while (true) {
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case COMMA: {
;
break;
}
default:
jj_la1[57] = jj_gen;
break label_36;
}
jj_consume_token(COMMA);
label_37: while (true) {
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case S: {
;
break;
}
default:
jj_la1[58] = jj_gen;
break label_37;
}
jj_consume_token(S);
}
selList.add(sel);
sel = selector();
}
selList.add(sel);
return selList;
}
开发者ID:oswetto,项目名称:LoboEvolution,代码行数:38,代码来源:SACParserCSS2.java
注:本文中的org.w3c.css.sac.SelectorList类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论