Examples of NodeMatcher


Examples of org.pentaho.reporting.engine.classic.core.dom.NodeMatcher

  private static String findTitle(final String field, final Band titleHeader)
  {
    final MatcherContext context = new MatcherContext();
    context.setMatchSubReportChilds(false);

    NodeMatcher m = new AndMatcher(new ElementMatcher(LabelType.INSTANCE),
        new AttributeMatcher(AttributeNames.Wizard.NAMESPACE, AttributeNames.Wizard.LABEL_FOR, field));
    ReportElement match = ReportStructureMatcher.match(context, titleHeader, m);
    if (match == null)
    {
      if (titleHeader.getElementCount() > 0)
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.testsupport.selector.NodeMatcher

    band.addElement(table);

    final LogicalPageBox logicalPageBox = DebugReportRunner.layoutSingleBand(report, band, false, false);
    //ModelPrinter.INSTANCE.print(logicalPageBox);

    final NodeMatcher matcher = new ChildMatcher(new ElementMatcher("TableCellRenderBox"));
    final RenderNode[] all = MatchFactory.matchAll(logicalPageBox, matcher);


    // assert that the direct childs of a table-cell-render-box have the same width as the table-cell render box
   
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.testsupport.selector.NodeMatcher

    band.addElement(table);

    final LogicalPageBox logicalPageBox = DebugReportRunner.layoutSingleBand(report, band, false, false);
    //ModelPrinter.print(logicalPageBox);

    final NodeMatcher matcher = new ChildMatcher(new ElementMatcher("TableCellRenderBox"));
    final RenderNode[] all = MatchFactory.matchAll(logicalPageBox, matcher);

    assertEquals(1, all.length);
    for (final RenderNode renderNode : all)
    {
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.testsupport.selector.NodeMatcher

    band.addElement(table);

    final LogicalPageBox logicalPageBox = DebugReportRunner.layoutSingleBand(report, band, false, false);
    //ModelPrinter.print(logicalPageBox);

    final NodeMatcher matcher = new ChildMatcher(new ElementMatcher("TableCellRenderBox"));
    final RenderNode[] all = MatchFactory.matchAll(logicalPageBox, matcher);

    assertEquals(1, all.length);
    for (final RenderNode renderNode : all)
    {
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.testsupport.selector.NodeMatcher

    band.addElement(tableRow);

    final LogicalPageBox logicalPageBox = DebugReportRunner.layoutSingleBand(report, band, false, false);
    //ModelPrinter.print(logicalPageBox);

    final NodeMatcher matcher = new ChildMatcher(new ElementMatcher("TableCellRenderBox"));
    final RenderNode[] all = MatchFactory.matchAll(logicalPageBox, matcher);

    assertEquals(1, all.length);
    for (final RenderNode renderNode : all)
    {
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.testsupport.selector.NodeMatcher

    band.addElement(tableBody);

    final LogicalPageBox logicalPageBox = DebugReportRunner.layoutSingleBand(report, band, false, false);
    //ModelPrinter.INSTANCE.print(logicalPageBox);

    final NodeMatcher matcher = new ChildMatcher(new ElementMatcher("TableCellRenderBox"));
    final RenderNode[] all = MatchFactory.matchAll(logicalPageBox, matcher);

    assertEquals(1, all.length);
    for (final RenderNode renderNode : all)
    {
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.testsupport.selector.NodeMatcher

    band.addElement(tableBody);

    final LogicalPageBox logicalPageBox = DebugReportRunner.layoutSingleBand(report, band, false, false);
    //ModelPrinter.INSTANCE.print(logicalPageBox);

    final NodeMatcher matcher = new ChildMatcher(new ElementMatcher("TableCellRenderBox"));
    final RenderNode[] all = MatchFactory.matchAll(logicalPageBox, matcher);

    assertEquals(1, all.length);
    for (final RenderNode renderNode : all)
    {
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.testsupport.selector.NodeMatcher

    band.addElement(tableCell);

    final LogicalPageBox logicalPageBox = DebugReportRunner.layoutSingleBand(report, band, false, false);
    //ModelPrinter.print(logicalPageBox);

    final NodeMatcher matcher = new ChildMatcher(new ElementMatcher("TableCellRenderBox"));
    final RenderNode[] all = MatchFactory.matchAll(logicalPageBox, matcher);

    assertEquals(1, all.length);
    for (final RenderNode renderNode : all)
    {
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.testsupport.selector.NodeMatcher

    band.addElement(table);

    final LogicalPageBox logicalPageBox = DebugReportRunner.layoutSingleBand(report, band, false, false);
    //ModelPrinter.print(logicalPageBox);

    final NodeMatcher matcher = new ChildMatcher(new ElementMatcher("TableCellRenderBox"));
    final RenderNode[] all = MatchFactory.matchAll(logicalPageBox, matcher);

    final NodeMatcher childMatcher = new AndMatcher(new ElementMatcher("ParagraphRenderBox"), new AttributeMatcher("value"));
    assertEquals(6, all.length);
    for (final RenderNode renderNode : all)
    {
      final RenderNode node = MatchFactory.match(renderNode, childMatcher);
      assertNotNull(node);
View Full Code Here

Examples of org.vietspider.html.path2.NodeMatcher

  }
 
  private List<TreeItem> selectNode(INode inode, TreeItem [] items){
    String name  = inode.getName()+"-";
    List<TreeItem>  list = new ArrayList<TreeItem>();
    NodeMatcher expMatcher = new NodeMatcher();
    for(TreeItem item : items){
      if(item.getText().startsWith(name)){
        String indexValue = item.getText().substring(name.length());
        int index = Integer.parseInt(indexValue);
       
        if(inode instanceof NodeExp) {
          NodeExp nodeExp = (NodeExp)inode;
          if(expMatcher.match(nodeExp.getPattern(), index)) {
            Attribute [] attrs = nodeExp.getAttributes();
            if(attrs == null || attrs.length < 1) {
              list.add(item);
            } else {
              String data = (String)item.getData();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.