Package org.mozilla.interfaces

Examples of org.mozilla.interfaces.nsIDOMNodeList


    StringBuilder builder = new StringBuilder();
    for(int i = 0;  i<  selection.getRangeCount(); i++) {
      nsIDOMRange idomRange = selection.getRangeAt(i);
      nsIDOMDocumentFragment fragment = idomRange.cloneContents();

      nsIDOMNodeList nodeList = fragment.getChildNodes();
      for(int k = 0;  k < nodeList.getLength(); k++) {
        buildTextNode(builder, nodeList.item(k));
      }
    }
    String text = builder.toString().trim();
    if(text.length() > 0) return text;
View Full Code Here


    StringBuilder builder = new StringBuilder();
    for(int i = 0;  i<  selection.getRangeCount(); i++) {
      nsIDOMRange idomRange = selection.getRangeAt(i);
      nsIDOMDocumentFragment fragment = idomRange.cloneContents();

      nsIDOMNodeList nodeList = fragment.getChildNodes();
      for(int k = 0;  k < nodeList.getLength(); k++) {
        buildHTMLNode(0, builder, nodeList.item(k));
      }
    }
    String text = builder.toString().trim();
    if(text.length() > 0) return text;
View Full Code Here

    builder.append('\n');
    if(node.getNodeName().charAt(0) == '#') {
      if(node.getNodeValue().trim().isEmpty()) return;
      builder.append(node.getNodeValue().trim());
    } else {
      nsIDOMNodeList children = node.getChildNodes();
      if(children != null) {
        for(long i = 0; i < children.getLength(); i++) {
          buildTextNode(builder, children.item(i));
        }
      }
    }
  }
View Full Code Here

          builder.append('=').append('\"').append(attr.getNodeValue()).append('\"');
        }
      }
      builder.append('>');

      nsIDOMNodeList children = node.getChildNodes();
      if(children != null) {
        for(long i = 0; i < children.getLength(); i++) {
          buildHTMLNode(tab + 2, builder, children.item(i));
        }
      }

      builder.append('\n');
      for(int i = 0; i < tab; i++) {
View Full Code Here

      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

      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

      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

      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

    *                      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

      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

Related Classes of org.mozilla.interfaces.nsIDOMNodeList

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.