本文整理汇总了Java中org.w3c.css.sac.Selector类的典型用法代码示例。如果您正苦于以下问题:Java Selector类的具体用法?Java Selector怎么用?Java Selector使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Selector类属于org.w3c.css.sac包,在下文中一共展示了Selector类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getBestStyle
import org.w3c.css.sac.Selector; //导入依赖的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: getCssText
import org.w3c.css.sac.Selector; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public String getCssText(final CSSFormat format) {
final StringBuilder sb = new StringBuilder();
if (null != ancestorSelector_) {
sb.append(((CSSFormatable) ancestorSelector_).getCssText(format));
}
if (Selector.SAC_PSEUDO_ELEMENT_SELECTOR != getSimpleSelector().getSelectorType()) {
sb.append(' ');
}
if (null != simpleSelector_) {
sb.append(((CSSFormatable) simpleSelector_).getCssText(format));
}
return sb.toString();
}
开发者ID:oswetto,项目名称:LoboEvolution,代码行数:22,代码来源:DescendantSelectorImpl.java
示例3: AbstractSiblingSelector
import org.w3c.css.sac.Selector; //导入依赖的package包/类
/**
* Creates a new SiblingSelector object.
*/
protected AbstractSiblingSelector(short type,
Selector sel,
SimpleSelector simple) {
nodeType = type;
selector = sel;
simpleSelector = simple;
}
开发者ID:git-moss,项目名称:Push2Display,代码行数:11,代码来源:AbstractSiblingSelector.java
示例4: item
import org.w3c.css.sac.Selector; //导入依赖的package包/类
/**
* <b>SAC</b>: Returns the selector at the specified index, or
* <code>null</code> if this is not a valid index.
*/
public Selector item(int index) {
if (index < 0 || index >= length) {
return null;
}
return list[index];
}
开发者ID:git-moss,项目名称:Push2Display,代码行数:11,代码来源:CSSSelectorList.java
示例5: append
import org.w3c.css.sac.Selector; //导入依赖的package包/类
/**
* Appends an item to the list.
*/
public void append(Selector item) {
if (length == list.length) {
// list is full, grow to 1.5 * size
Selector[] tmp = list;
list = new Selector[ 1+ list.length + list.length / 2];
System.arraycopy( tmp, 0, list, 0, tmp.length );
}
list[length++] = item;
}
开发者ID:git-moss,项目名称:Push2Display,代码行数:13,代码来源:CSSSelectorList.java
示例6: DefaultDescendantSelector
import org.w3c.css.sac.Selector; //导入依赖的package包/类
/**
* <b>SAC</b>: Implements {@link
* SelectorFactory#createDescendantSelector(Selector,SimpleSelector)}.
*/
public DescendantSelector createDescendantSelector
(Selector parent,
SimpleSelector descendant)
throws CSSException {
return new DefaultDescendantSelector(parent, descendant);
}
开发者ID:git-moss,项目名称:Push2Display,代码行数:11,代码来源:DefaultSelectorFactory.java
示例7: DefaultDirectAdjacentSelector
import org.w3c.css.sac.Selector; //导入依赖的package包/类
/**
* <b>SAC</b>: Implements {@link
* SelectorFactory#createDirectAdjacentSelector(short,Selector,SimpleSelector)}.
*/
public SiblingSelector createDirectAdjacentSelector
(short nodeType,
Selector child,
SimpleSelector directAdjacent)
throws CSSException {
return new DefaultDirectAdjacentSelector(nodeType, child,
directAdjacent);
}
开发者ID:git-moss,项目名称:Push2Display,代码行数:13,代码来源:DefaultSelectorFactory.java
示例8: CSSDescendantSelector
import org.w3c.css.sac.Selector; //导入依赖的package包/类
/**
* <b>SAC</b>: Implements {@link
* SelectorFactory#createDescendantSelector(Selector,SimpleSelector)}.
*/
public DescendantSelector createDescendantSelector
(Selector parent,
SimpleSelector descendant)
throws CSSException {
return new CSSDescendantSelector(parent, descendant);
}
开发者ID:git-moss,项目名称:Push2Display,代码行数:11,代码来源:CSSSelectorFactory.java
示例9: CSSDirectAdjacentSelector
import org.w3c.css.sac.Selector; //导入依赖的package包/类
/**
* <b>SAC</b>: Implements {@link
* SelectorFactory#createDirectAdjacentSelector(short,Selector,SimpleSelector)}.
*/
public SiblingSelector createDirectAdjacentSelector
(short nodeType,
Selector child,
SimpleSelector directAdjacent)
throws CSSException {
return new CSSDirectAdjacentSelector(nodeType, child,
directAdjacent);
}
开发者ID:git-moss,项目名称:Push2Display,代码行数:13,代码来源:CSSSelectorFactory.java
示例10: item
import org.w3c.css.sac.Selector; //导入依赖的package包/类
@Override
public Selector item(int index) {
if ((index < 0) || (index >= current)) {
return null;
}
return selectors[index];
}
开发者ID:fjalvingh,项目名称:domui,代码行数:8,代码来源:SelectorListImpl.java
示例11: addSelector
import org.w3c.css.sac.Selector; //导入依赖的package包/类
public void addSelector(Selector selector) {
if (current == selectors.length) {
Selector[] old = selectors;
selectors = new Selector[old.length + old.length];
System.arraycopy(old, 0, selectors, 0, old.length);
}
selectors[current++] = selector;
}
开发者ID:fjalvingh,项目名称:domui,代码行数:9,代码来源:SelectorListImpl.java
示例12: findRule
import org.w3c.css.sac.Selector; //导入依赖的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
示例13: AbstractSiblingSelector
import org.w3c.css.sac.Selector; //导入依赖的package包/类
/**
* Creates a new SiblingSelector object.
*/
protected AbstractSiblingSelector(short type,
Selector sel,
SimpleSelector simple) {
nodeType = type;
selector = sel;
simpleSelector = simple;
}
开发者ID:BowlerHatLLC,项目名称:feathers-sdk,代码行数:11,代码来源:AbstractSiblingSelector.java
示例14: selector
import org.w3c.css.sac.Selector; //导入依赖的package包/类
final public Selector selector() throws ParseException {
Selector sel;
SimpleSelector pseudoElementSel = null;
try {
sel = simpleSelector(null, ' ');
label_16: while (true) {
if (jj_2_1(2)) {
;
} else {
break label_16;
}
jj_consume_token(S);
sel = simpleSelector(sel, ' ');
}
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case FIRST_LINE:
case FIRST_LETTER: {
pseudoElementSel = pseudoElement();
break;
}
default:
jj_la1[23] = jj_gen;
;
}
if (pseudoElementSel != null) {
sel = getSelectorFactory().createDescendantSelector(sel, pseudoElementSel);
}
handleSelector(sel);
return sel;
} catch (ParseException e) {
throw toCSSParseException("invalidSelector", e);
}
}
开发者ID:oswetto,项目名称:LoboEvolution,代码行数:34,代码来源:SACParserCSS1.java
示例15: selectorList
import org.w3c.css.sac.Selector; //导入依赖的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
示例16: selector
import org.w3c.css.sac.Selector; //导入依赖的package包/类
final public Selector selector() throws ParseException {
Selector sel;
char comb;
try {
sel = simpleSelector(null, ' ');
label_29: while (true) {
if (jj_2_1(2)) {
;
} else {
break label_29;
}
comb = combinator();
sel = simpleSelector(sel, comb);
}
label_30: while (true) {
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case S: {
;
break;
}
default:
jj_la1[46] = jj_gen;
break label_30;
}
jj_consume_token(S);
}
return sel;
} catch (ParseException e) {
throw toCSSParseException("invalidSelector", e);
}
}
开发者ID:oswetto,项目名称:LoboEvolution,代码行数:32,代码来源:SACParserCSS21.java
示例17: selectorList
import org.w3c.css.sac.Selector; //导入依赖的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
示例18: selector
import org.w3c.css.sac.Selector; //导入依赖的package包/类
final public Selector selector() throws ParseException {
Selector sel;
char comb;
try {
sel = simpleSelector(null, ' ');
label_43: while (true) {
if (jj_2_1(2)) {
;
} else {
break label_43;
}
comb = combinator();
sel = simpleSelector(sel, comb);
}
label_44: while (true) {
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case S: {
;
break;
}
default:
jj_la1[65] = jj_gen;
break label_44;
}
jj_consume_token(S);
}
return sel;
} catch (ParseException e) {
throw toCSSParseException("invalidSelector", e);
}
}
开发者ID:oswetto,项目名称:LoboEvolution,代码行数:32,代码来源:SACParserCSS3.java
示例19: selector
import org.w3c.css.sac.Selector; //导入依赖的package包/类
final public Selector selector() throws ParseException {
Selector sel;
SimpleSelector pseudoElementSel = null;
try {
sel = simpleSelector(null, ' ');
label_24: while (true) {
if (jj_2_1(2)) {
;
} else {
break label_24;
}
jj_consume_token(S);
sel = simpleSelector(sel, ' ');
}
switch ((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case FIRST_LINE:
case FIRST_LETTER: {
pseudoElementSel = pseudoElement();
break;
}
default:
jj_la1[35] = jj_gen;
;
}
if (pseudoElementSel != null) {
sel = this.getSelectorFactory().createDescendantSelector(sel, pseudoElementSel);
}
this.handleSelector(sel);
return sel;
} catch (ParseException e) {
throw this.toCSSParseException("invalidSelector", e);
}
}
开发者ID:oswetto,项目名称:LoboEvolution,代码行数:34,代码来源:SACParserCSSmobileOKBasic1.java
示例20: setSelector
import org.w3c.css.sac.Selector; //导入依赖的package包/类
public void setSelector(final Selector child) {
selector_ = child;
if (child instanceof Locatable) {
setLocator(((Locatable) child).getLocator());
} else if (child == null) {
setLocator(null);
}
}
开发者ID:oswetto,项目名称:LoboEvolution,代码行数:9,代码来源:GeneralAdjacentSelectorImpl.java
注:本文中的org.w3c.css.sac.Selector类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论