Java Code Examples for org.w3c.css.sac.Condition#SAC_PSEUDO_CLASS_CONDITION

The following examples show how to use org.w3c.css.sac.Condition#SAC_PSEUDO_CLASS_CONDITION . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SimpleStyleRuleMatcher.java    From pentaho-reporting with GNU Lesser General Public License v2.1 6 votes vote down vote up
private boolean isPseudoElementRule( final CSSStyleRule rule ) {
  final CSSSelector selector = rule.getSelector();
  if ( selector == null ) {
    return false;
  }

  if ( selector.getSelectorType() != Selector.SAC_CONDITIONAL_SELECTOR ) {
    return false;
  }

  final ConditionalSelector cs = (ConditionalSelector) selector;
  final Condition condition = cs.getCondition();
  if ( condition.getConditionType() != Condition.SAC_PSEUDO_CLASS_CONDITION ) {
    return false;
  }
  return true;
}
 
Example 2
Source File: SimpleStyleRuleMatcher.java    From pentaho-reporting with GNU Lesser General Public License v2.1 6 votes vote down vote up
private boolean isPseudoElementRule( final ElementStyleRule rule ) {
  final List<CSSSelector> selectorList = rule.getSelectorList();
  for ( int i = 0; i < selectorList.size(); i += 1 ) {
    final CSSSelector selector = selectorList.get( i );
    if ( selector == null ) {
      continue;
    }

    if ( selector.getSelectorType() != Selector.SAC_CONDITIONAL_SELECTOR ) {
      continue;
    }

    final ConditionalSelector cs = (ConditionalSelector) selector;
    final Condition condition = cs.getCondition();
    if ( condition.getConditionType() != Condition.SAC_PSEUDO_CLASS_CONDITION ) {
      continue;
    }
    return true;
  }
  return false;
}
 
Example 3
Source File: PseudoClassConditionImpl.java    From pentaho-reporting with GNU Lesser General Public License v2.1 4 votes vote down vote up
/**
 * An integer indicating the type of <code>Condition</code>.
 */
public short getConditionType() {
  return Condition.SAC_PSEUDO_CLASS_CONDITION;
}