Examples of nsIDOMNodeList


Examples of org.mozilla.interfaces.nsIDOMNodeList

      final nsIDOMNode text2 = context.mock(nsIDOMNode.class, "text2");
      final nsIDOMNode text3 = context.mock(nsIDOMNode.class, "text3");
      final nsIDOMNode strong = context.mock(nsIDOMNode.class, "strong");
      final nsIDOMNode text4 = context.mock(nsIDOMNode.class, "text4");

      final nsIDOMNodeList p_children = context.mock(nsIDOMNodeList.class, "p_children");
      final nsIDOMNodeList em_children = context.mock(nsIDOMNodeList.class, "em_children");
      final nsIDOMNodeList strong_children = context.mock(nsIDOMNodeList.class, "strong_children");

      context.checking(new Expectations() { {
      // p
         this.oneOf(p).hasChildNodes();
         this.will(returnValue(true));
View Full Code Here

Examples of org.mozilla.interfaces.nsIDOMNodeList

      System.out.println("=== Inspecting the table row node ===");
      inspect(row);

      System.out.println("=== Listing the menu ===");
      nsIDOMNodeList cells = row.getElementsByTagName("th");
      for (long i = 0, len = cells.getLength(); i < len; i++) {
         nsIDOMHTMLTableCellElement cell = this.asTableCell(cells.item(i));
         String text = this.exploreTableCell(cell);
         System.out.println("Menu #" + (i+1) + " is " + text);
         }
      }
View Full Code Here

Examples of org.mozilla.interfaces.nsIDOMNodeList

      System.out.println("=== Inspecting the table row node ===");
      inspect(row);

      System.out.println("=== Listing the menu ===");
      nsIDOMNodeList cells = row.getElementsByTagName("th");
      for (long i = 0, len = cells.getLength(); i < len; i++) {
         nsIDOMHTMLTableCellElement cell = asTableCell(cells.item(i));
         String text = this.exploreTableCell(cell);
         System.out.println("Menu #" + (i+1) + " is " + text);
         }
      }
View Full Code Here

Examples of org.mozilla.interfaces.nsIDOMNodeList

      if (nsIDOMNode.TEXT_NODE == type) {
         String text = node.getNodeValue();
         sb.append(text);
         }

      nsIDOMNodeList children = node.getChildNodes();
      for (long i = 0, len = children.getLength(); i < len; i++) {
         nsIDOMNode child = children.item(i);
         String text = this.getTextFrom(child);
         sb.append(text);
         }

      String text = sb.toString();
View Full Code Here

Examples of org.mozilla.interfaces.nsIDOMNodeList

      System.out.println("=== Inspecting the div node ===");
      inspect(div);

      System.out.println("=== Listing the menu ===");
      nsIDOMNodeList anchors = div.getElementsByTagName("a");
      for (long i = 0, len = anchors.getLength(); i < len; i++) {
         nsIDOMHTMLAnchorElement anchor = asAnchor(anchors.item(i));
         String text = this.exploreTableCell(anchor);
         System.out.println("Menu #" + (i+1) + " is " + text);
         }
      }
View Full Code Here

Examples of org.mozilla.interfaces.nsIDOMNodeList

      list.add(node);

      boolean has_children = node.hasChildNodes();
      if (has_children) {
         nsIDOMNodeList child_nodes = node.getChildNodes();
         for (long l = 0, len = child_nodes.getLength(); l < len; l++) {
         // child will be added in the list of children
            nsIDOMNode child = child_nodes.item(l);
            List<nsIDOMNode> children = this.getAllChildren(child);
            list.addAll(children);
            }
         }
View Full Code Here

Examples of org.mozilla.interfaces.nsIDOMNodeList

    *                      children, depth-first; {@code false} otherwise.
    */
   public static void inspectChildren(nsIDOMNode node, boolean recursive) {
      boolean has_children = node.hasChildNodes();
      if (has_children) {
         nsIDOMNodeList children = node.getChildNodes();
         long len = children.getLength();

         System.out.print("The node has " + len + " children: ");
         for (long i = 0; i < len; i++) {
            String name = children.item(i).getNodeName();
            System.out.print(name + ",");
            }
         System.out.println();

         for (long i = 0; recursive && i < len; i++) {
            nsIDOMNode child = children.item(i);
            System.out.println("Inspecting children #" + i);
            inspect(child, true);
            }
         }
      else {
View Full Code Here

Examples of org.mozilla.interfaces.nsIDOMNodeList

      if (nsIDOMNode.TEXT_NODE == type) {
         String text = node.getNodeValue();
         sb.append(text);
         }

      nsIDOMNodeList children = node.getChildNodes();
      for (long i = 0, len = children.getLength(); i < len; i++) {
         nsIDOMNode child = children.item(i);
         String text = asPlainText(child);
         sb.append(text);
         }

      String text = sb.toString();
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.