Examples of replaceChild()


Examples of com.google.javascript.rhino.Node.replaceChild()

    String result = stringAsString.substring(start, start + length);
    Node resultNode = IR.string(result);

    Node parent = n.getParent();
    parent.replaceChild(n, resultNode);
    reportCodeChange();
    return resultNode;
  }

  /**
 
View Full Code Here

Examples of com.google.javascript.rhino.Node.replaceChild()

    String result = stringAsString.substring(start, end);
    Node resultNode = IR.string(result);

    Node parent = n.getParent();
    parent.replaceChild(n, resultNode);
    reportCodeChange();
    return resultNode;
  }

  /**
 
View Full Code Here

Examples of com.google.template.soy.exprtree.OperatorNodes.MinusOpNode.replaceChild()

    expr.addChild(dataRef);

    IncompleteEvalVisitor iev = new IncompleteEvalVisitor(ImmutableMap.of("boo", 13.0));
    assertEquals(4.0, iev.exec(expr));

    expr.replaceChild(0, new IntegerNode(34));

    assertEquals(21.0, iev.exec(expr));
  }

View Full Code Here

Examples of com.google.template.soy.soytree.SoyNode.BlockNode.replaceChild()

        return// don't replace this node
      }
    }

    // Replace this node with a RawTextNode.
    parent.replaceChild(node, new RawTextNode(nodeIdGen.genId(), rawText));
    madeReplacement = true;
  }


  // -----------------------------------------------------------------------------------------------
View Full Code Here

Examples of com.intellij.lang.ASTNode.replaceChild()

    ASTNode parentNode = element1.getParent().getNode();
    if (elements.length > 1) {
      parentNode.removeRange(element1.getNode().getTreeNext(), elements[elements.length - 1].getNode().getTreeNext());
    }
    parentNode.replaceChild(element1.getNode(), newStmt.getNode());

    return getSurroundSelectionRange(newStmt);
  }

  protected static void addStatements(HaxeBlockStatement block, PsiElement[] elements) throws IncorrectOperationException {
View Full Code Here

Examples of javax.xml.soap.SOAPHeader.replaceChild()

                 * then insert it as a header element.
                 */
                SOAPHeaderElement headerElement = soapHeader.addHeaderElement(getDummyQName());
                Marshaller marshaller = jaxbCtx.createMarshaller();
                marshaller.marshal(coordinationContext, headerElement);
                soapHeader.replaceChild(headerElement.getChildNodes().item(0), headerElement);
                // ok, now we need to locate the inserted node and set the mustunderstand attribute
                Iterator<SOAPHeaderElement> iterator = soapHeader.examineAllHeaderElements();
                while (iterator.hasNext()) {
                    headerElement = iterator.next();
                    if (CoordinationConstants.WSCOOR_ELEMENT_COORDINATION_CONTEXT_QNAME.equals(headerElement.getElementQName())) {
View Full Code Here

Examples of mf.org.w3c.dom.Node.replaceChild()

                        return prevSibling; //don't advance                       
                    }
                    else {
                        Text text = fDocument.createTextNode(node.getNodeValue());
                        Node parent = node.getParentNode();
                        node = parent.replaceChild(text, node);
                        return text;  //don't advance
                       
                    }
                }
View Full Code Here

Examples of nu.xom.Document.replaceChild()

        Element temp = new Element("temp");
        Comment c2 = new Comment("new comment");
        temp.appendChild(c2);
       
        try {
            doc.replaceChild(original, c2);
            fail("Missed multiple parent exception");
        }
        catch (MultipleParentException success) {
            assertEquals(2, doc.getChildCount());
        }
View Full Code Here

Examples of nu.xom.Element.replaceChild()

        Element parent = new Element("parent");
        Text child = new Text("child");
        parent.appendChild(child);
       
        try {
            parent.replaceChild(child, new DocType("root"));
            fail("allowed doctype child of element");
        }
        catch (IllegalAddException success) {
            assertEquals(parent, child.getParent());
            assertEquals(1, parent.getChildCount());
View Full Code Here

Examples of nu.xom.ParentNode.replaceChild()

          if (result instanceof Attribute) {
            result.detach();
            ((Element) parent).addAttribute((Attribute)result);
          } else {
            if (isRoot && result instanceof Element) {
              parent.replaceChild(node, result);
            } else {
              result.detach();
              parent.insertChild(result, position);
            }
            position++;
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.