org.w3c.css.sac.SiblingSelector Java Examples

The following examples show how to use org.w3c.css.sac.SiblingSelector. 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: SelectorFactoryImpl.java    From pentaho-reporting with GNU Lesser General Public License v2.1 5 votes vote down vote up
/**
 * Creates a direct adjacent selector.
 *
 * @param child    the child selector
 * @param adjacent the direct adjacent selector
 * @return the combinator selector.
 * @throws CSSException If this selector is not supported.
 */
public SiblingSelector createDirectAdjacentSelector( short nodeType,
                                                     Selector child,
                                                     SimpleSelector directAdjacent )
  throws CSSException {
  if ( nodeType != 1 ) {
    throw new CSSException( CSSException.SAC_NOT_SUPPORTED_ERR );
  } else {
    return new DirectAdjacentSelectorImpl( child, directAdjacent );
  }
}
 
Example #2
Source File: FixNamespaceSelectorFactory.java    From pentaho-reporting with GNU Lesser General Public License v2.1 5 votes vote down vote up
public SiblingSelector createDirectAdjacentSelector( final short nodeType,
                                                     final Selector child,
                                                     final SimpleSelector directAdjacent )
  throws
  CSSException {
  return parent.createDirectAdjacentSelector( nodeType, child, directAdjacent );
}
 
Example #3
Source File: SimpleStyleRuleMatcher.java    From pentaho-reporting with GNU Lesser General Public License v2.1 5 votes vote down vote up
private boolean isSilblingMatch( final LayoutElement node,
                                 final SiblingSelector select ) {
  LayoutElement pred = node.getPreviousLayoutElement();
  while ( pred != null ) {
    if ( isMatch( pred, select ) ) {
      return true;
    }
    pred = pred.getPreviousLayoutElement();
  }
  return false;
}
 
Example #4
Source File: SimpleStyleRuleMatcher.java    From pentaho-reporting with GNU Lesser General Public License v2.1 5 votes vote down vote up
private boolean isSilblingMatch( final ReportElement node, final SiblingSelector select ) {
  ReportElement pred = getPreviousReportElement( node );
  while ( pred != null ) {
    if ( isMatch( pred, select ) ) {
      return true;
    }
    pred = getPreviousReportElement( pred );
  }
  return false;
}
 
Example #5
Source File: CSSSelectorFactory.java    From tm4e with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public SiblingSelector createDirectAdjacentSelector(short arg0, Selector arg1, SimpleSelector arg2)
		throws CSSException {
	throw new UnsupportedOperationException();
}
 
Example #6
Source File: FixNamespaceSelectorFactory.java    From pentaho-reporting with GNU Lesser General Public License v2.1 4 votes vote down vote up
public SiblingSelector createDirectAdjacentSelector( final short nodeType, final Selector child,
    final SimpleSelector directAdjacent ) throws CSSException {
  return parent.createDirectAdjacentSelector( nodeType, child, directAdjacent );
}
 
Example #7
Source File: CSSSelectorFactory.java    From pentaho-reporting with GNU Lesser General Public License v2.1 3 votes vote down vote up
/**
 * Creates a sibling selector.
 *
 * @param nodeType the type of nodes in the siblings list.
 * @param child    the child selector
 * @param adjacent the direct adjacent selector
 * @return the sibling selector with nodeType equals to org.w3c.dom.Node.ELEMENT_NODE
 * @throws CSSException If this selector is not supported.
 */
public SiblingSelector createDirectAdjacentSelector( final short nodeType,
                                                     final Selector child,
                                                     final SimpleSelector directAdjacent )
  throws CSSException {
  return new CSSSilblingSelector( nodeType, child, directAdjacent );
}
 
Example #8
Source File: CSSSelectorFactory.java    From pentaho-reporting with GNU Lesser General Public License v2.1 2 votes vote down vote up
/**
 * Creates a sibling selector.
 *
 * @param nodeType
 *          the type of nodes in the siblings list.
 * @param child
 *          the child selector
 * @param directAdjacent
 *          the direct adjacent selector
 * @return the sibling selector with nodeType equals to org.w3c.dom.Node.ELEMENT_NODE
 * @throws CSSException
 *           If this selector is not supported.
 */
public SiblingSelector createDirectAdjacentSelector( final short nodeType, final Selector child,
    final SimpleSelector directAdjacent ) throws CSSException {
  return new CSSSilblingSelector( nodeType, child, directAdjacent );
}