Examples of insertBefore()


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

        //replace the text node
        Text currentNode = null;
        if (isReadOnly()) {
            Text newNode = this.ownerDocument().createTextNode(content);
            if (parent != null) { // check if node in the tree
                parent.insertBefore(newNode, this);
                parent.removeChild(this);
                currentNode = newNode;
            } else {
                return newNode;
            }
View Full Code Here

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

        setNodeValue(data.substring(0, offset));

        // insert new text node
        Node parentNode = getParentNode();
        if (parentNode != null) {
            parentNode.insertBefore(newText, nextSibling);
        }

        return newText;

    } // splitText(int):Text
View Full Code Here

Examples of net.sf.latexdraw.parsers.svg.SVGAttr.insertBefore()

  @Test
  public void testUselessMethods() {
    SVGAttr attr = new SVGAttr("", "", node); //$NON-NLS-1$ //$NON-NLS-2$
    assertNull(attr.removeChild(null));
    assertNull(attr.insertBefore(null, null));
    assertNull(attr.getAttributes());
    assertNull(attr.getFirstChild());
    assertNull(attr.getLastChild());
    assertNull(attr.appendChild(null));
  }
View Full Code Here

Examples of org.antlr.runtime.TokenRewriteStream.insertBefore()

      "B : 'b';\n" +
      "C : 'c';\n");
    CharStream input = new ANTLRStringStream("abc");
    Interpreter lexEngine = new Interpreter(g, input);
    TokenRewriteStream tokens = new TokenRewriteStream(lexEngine);
    tokens.insertBefore(0, "0");
    String result = tokens.toString();
    String expecting = "0abc";
    assertEquals(expecting, result);
  }
View Full Code Here

Examples of org.antlr.v4.runtime.TokenStreamRewriter.insertBefore()

                       "C : 'c';\n");
    LexerInterpreter lexEngine = g.createLexerInterpreter(new ANTLRInputStream("abc"));
    CommonTokenStream stream = new CommonTokenStream(lexEngine);
    stream.fill();
    TokenStreamRewriter tokens = new TokenStreamRewriter(stream);
    tokens.insertBefore(0, "0");
    String result = tokens.getText();
    String expecting = "0abc";
    assertEquals(expecting, result);
  }
View Full Code Here

Examples of org.apache.poi.hwpf.usermodel.Range.insertBefore()

        //Task:TODO Use a doc file of the project and adapt the temp directories
       
        HWPFDocument document = new HWPFDocument( new FileInputStream( "c:/temp/test.doc"));
        Range range = document.getRange();
        //range.delete();
        range.insertBefore("hallo christian");
          System.out.println("Example you supplied:");
          System.out.println("---------------------");
          for (int x = 0; x < range.numSections(); x++)
          {
            Section section = range.getSection(x);
View Full Code Here

Examples of org.apache.tapestry5.internal.plastic.asm.tree.InsnList.insertBefore()

            String methodDescription = opcode == GETFIELD ? "()" + fnode.desc : "(" + fnode.desc + ")V";

            // Replace the field access node with the appropriate method invocation.

            insns.insertBefore(fnode, new MethodInsnNode(INVOKEVIRTUAL, fnode.owner, mn.name, methodDescription));

            it.remove();

            unusedAccessMethods.remove(mn);
        }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.core.dom.rewrite.ListRewrite.insertBefore()

       ListRewrite rewrite = rewriter.getListRewrite(parent, childListPropertyDescriptor);
       switch (this.insertionPolicy) {
         case INSERT_BEFORE:
           ASTNode element = ((JavaElement) this.anchorElement).findNode(this.cuAST);
           if (childListPropertyDescriptor.getElementType().isAssignableFrom(element.getClass()))
             rewrite.insertBefore(child, element, null);
           else
             // case of an empty import list: the anchor element is the top level type and cannot be used in insertBefore as it is not the same type
             rewrite.insertLast(child, null);
           break;
         case INSERT_AFTER:
View Full Code Here

Examples of org.eclipse.help.internal.UAElement.insertBefore()

            TocContribution srcContribution = getContribution(HrefUtil.normalizeHref(destContribution.getContributorId(), toc));
            if (srcContribution != null) {
              process(srcContribution);
              IUAElement[] children = srcContribution.getToc().getChildren();
              for (int i=0;i<children.length;++i) {
                parent.insertBefore((UAElement)children[i], link);
              }
              addExtraDocuments(destContribution, srcContribution.getExtraDocuments());
            }
            parent.removeChild(link);
          }
View Full Code Here

Examples of org.eclipse.jdt.core.IPackageFragmentRoot.insertBefore()

          boolean inserted = false;
          NodeList children = root.getChildNodes();
          for(int i=0;i<children.getLength();i++){
            Node node = children.item(i);
            if(node instanceof Element){
              root.insertBefore(pages, node);
              inserted = true;
              break;
            }
          }
          if(!inserted){
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.