Ejemplo n.º 1
0
 public Row(CompositeTag rowNode) {
   this.rowNode = rowNode;
   NodeList nodeList = rowNode.getChildren();
   for (int i = 0; i < nodeList.size(); i++) {
     Node node = nodeList.elementAt(i);
     if (node instanceof TableColumn) cells.add(new Cell((TableColumn) node));
   }
 }
Ejemplo n.º 2
0
 private void setExecutionResult(ExecutionResult executionResult) {
   NodeList cells = rowNode.getChildren();
   for (int i = 0; i < cells.size(); i++) {
     Node cell = cells.elementAt(i);
     if (cell instanceof Tag) {
       Tag tag = (Tag) cell;
       tag.setAttribute("class", executionResult.toString(), '"');
     }
   }
 }
Ejemplo n.º 3
0
  /**
   * Accept tags with children acceptable to the filter.
   *
   * @param node The node to check.
   * @return <code>true</code> if the node has an acceptable child, <code>false</code> otherwise.
   */
  public boolean accept(Node node) {
    CompositeTag tag;
    NodeList children;
    boolean ret;

    ret = false;
    if (node instanceof CompositeTag) {
      tag = (CompositeTag) node;
      children = tag.getChildren();
      if (null != children) {
        for (int i = 0; !ret && i < children.size(); i++)
          if (getChildFilter().accept(children.elementAt(i))) ret = true;
        // do recursion after all children are checked
        // to get breadth first traversal
        if (!ret && getRecursive())
          for (int i = 0; !ret && i < children.size(); i++)
            if (accept(children.elementAt(i))) ret = true;
      }
    }

    return (ret);
  }
Ejemplo n.º 4
0
 private void appendCell(Cell newCell) {
   rowNode.getChildren().add(newCell.getColumnNode());
   cells.add(newCell);
 }