Package org.htmlparser.tags

Examples of org.htmlparser.tags.TableColumn


        assertTrue ("table should have 3 nodes", 3 == table.getChildCount ());
        assertType ("row", TableRow.class, table.childAt (1));
        TableRow row = (TableRow)table.childAt (1);
        assertTrue ("row should have 3 nodes", 3 == row.getChildCount ());
        assertType ("column", TableColumn.class, row.childAt (1));
        TableColumn column = (TableColumn)row.childAt (1);
        assertTrue ("column should have 1 node", 1 == column.getChildCount ());
        assertType ("element", Div.class, column.childAt (0));
        Div div = (Div)column.childAt (0);
        assertTrue ("div should have 3 nodes", 3 == div.getChildCount ());
        assertType ("link", LinkTag.class, div.childAt (1));
        LinkTag link = (LinkTag)div.childAt (1);
        assertTrue ("link contents", link.getLink ().equals ("http://www.nba.com/heat/"));
        assertType ("bogus div", Div.class, div.childAt (2));
View Full Code Here


        assertType("second tag",TableTag.class,html.getChild (1));
        TableTag table = (TableTag)html.getChild (1);
        assertEquals("rows",3,table.getRowCount());
        TableRow tr = table.getRow(2);
        assertEquals("columns",1,tr.getColumnCount());
        TableColumn td = tr.getColumns()[0];
        Node node = td.childAt(1);
        assertType("node",TableTag.class,node);
        TableTag table2 = (TableTag)node;
        assertEquals("second table row count",1,table2.getRowCount());
        tr = table2.getRow(0);
        assertEquals("second table col count",2,tr.getColumnCount());
View Full Code Here

    createParser(HTML_WITH_SPAN);
    parser.addScanner(new TableScanner(parser));
    parser.addScanner(new SpanScanner());
    parseAndAssertNodeCount(1);
    assertType("node", TableColumn.class, node[0]);
    TableColumn col = (TableColumn) node[0];
    Node spans[] = col.searchFor(Span.class).toNodeArray();
    assertEquals("number of spans found", 2, spans.length);
    assertStringEquals("span 1", "Flavor: small(90 to 120 minutes)", spans[0].toPlainTextString());
    assertStringEquals(
        "span 2",
        "The short version of our Refactoring Challenge gives participants a general feel for the smells in the code base and includes time for participants to find and implement important refactorings.
",
View Full Code Here

    parser.registerScanners();
    // parser.addScanner(new TableScanner(parser));
    parseAndAssertNodeCount(2);
    assertType("first node type", TableRow.class, node[0]);
    TableRow row = (TableRow) node[0];
    TableColumn col = row.getColumns()[1];
    Node node = col.children().nextNode();
    assertType("Node identified should be HTMLLinkTag", LinkTag.class, node);
    LinkTag linkTag = (LinkTag) node;
    Node nodeInsideLink = linkTag.children().nextNode();
    assertType("Tag within link should be an image tag", ImageTag.class, nodeInsideLink);
    ImageTag imageTag = (ImageTag) nodeInsideLink;
View Full Code Here

    // Register the image scanner
    parser.registerScanners();
    parser.addScanner(new TableScanner(parser));
    parseAndAssertNodeCount(1);
    assertType("node should be", TableColumn.class, node[0]);
    TableColumn col = (TableColumn) node[0];
    Node node = col.children().nextNode();
    assertType("node inside column", ImageTag.class, node);
    ImageTag imageTag = (ImageTag) node;
    // Get the data from the node
    assertEquals("Image location", "http://www.cia.gov/graphics/images_home2/cia_banners_template3_01.gif",
        imageTag.getImageURL());
View Full Code Here

    assertType("second tag", TableTag.class, node[1]);
    TableTag table = (TableTag) node[1];
    assertEquals("rows", 3, table.getRowCount());
    TableRow tr = table.getRow(2);
    assertEquals("columns", 1, tr.getColumnCount());
    TableColumn td = tr.getColumns()[0];
    Node node = td.childAt(0);
    assertType("node", TableTag.class, node);
    TableTag table2 = (TableTag) node;
    assertEquals("second table row count", 1, table2.getRowCount());
    tr = table2.getRow(0);
    assertEquals("second table col count", 2, tr.getColumnCount());
View Full Code Here

      boolean allowSelfChildren) {
    super(filter, nameOfTagToMatch, tagEnders, endTagEnders, allowSelfChildren);
  }

  public Tag createTag(TagData tagData, CompositeTagData compositeTagData) {
    return new TableColumn(tagData, compositeTagData);
  }
View Full Code Here

    insertRowAfter(row, childRow);
  }

  private Row makeChildRow(Row row, Node contents, String type) {
    Row childRow = new Row();
    TableColumn column = (TableColumn) newTag(TableColumn.class);
    column.setChildren(new NodeList(contents));
    column.setAttribute("colspan", "" + colspan(row), '"');
    childRow.appendCell(new Cell(column));

    row.rowNode.setAttribute("class", type + " closed", '"');
    childRow.rowNode.setAttribute("class", type + "-detail closed-detail", '"');
    return childRow;
View Full Code Here

  private HtmlTable makeMockTable(String tableIdentifier) {
    // Create just enough "table" to test if
    TableTag tableTag = new TableTag();
    TableRow tableRow = new TableRow();
    TableColumn tableColumn = new TableColumn();
    tableColumn.setChildren(new NodeList(new TextNode(tableIdentifier)));
    tableRow.setChildren(new NodeList(tableColumn));
    tableTag.setChildren(new NodeList(tableRow));
    return new HtmlTable(tableTag);
  }
View Full Code Here

TOP

Related Classes of org.htmlparser.tags.TableColumn

Copyright © 2018 www.massapicom. 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.