Package org.eclipse.text.edits

Examples of org.eclipse.text.edits.TextEdit.apply()


        }
       
        TextEdit edits = rewrite.rewriteAST(document, compilationUnit.getJavaProject().getOptions(true));
       
        // computation of the new source code
        edits.apply(document);
        String newSource = document.get();
       
        // update of the compilation unit
        compilationUnit.getBuffer().setContents(newSource);
    }
View Full Code Here


   
    Map options = compilationUnit.getJavaProject().getOptions(true);
    TextEdit edits = rewrite.rewriteAST(document, options);
   
    // computation of the new source code
    edits.apply(document);
    if (importEdits != null) {
      importEdits.apply(document);
    }
    String newSource = document.get();
   
View Full Code Here

   
    Map options = compilationUnit.getJavaProject().getOptions(true);
    TextEdit edits = rewrite.rewriteAST(document, options);
   
    // computation of the new source code
    edits.apply(document);
    if (importEdits != null) {
      importEdits.apply(document);
    }
    String newSource = document.get();
   
View Full Code Here

   
    Map options = compilationUnit.getJavaProject().getOptions(true);
    TextEdit edits = rewrite.rewriteAST(document, options);
   
    // computation of the new source code
    edits.apply(document);
    if (importEdits != null) {
      importEdits.apply(document);
    }
    String newSource = document.get();
   
View Full Code Here

   
    Map options = compilationUnit.getJavaProject().getOptions(true);
    TextEdit edits = rewrite.rewriteAST(document, options);
   
    // computation of the new source code
    edits.apply(document);
    if (importEdits != null) {
      importEdits.apply(document);
    }
    String newSource = document.get();
   
View Full Code Here

   
    Map options = compilationUnit.getJavaProject().getOptions(true);
    TextEdit edits = rewrite.rewriteAST(document, options);
   
    // computation of the new source code
    edits.apply(document);
    String newSource = document.get();
   
    // update of the compilation unit
    compilationUnit.getBuffer().setContents(newSource);
  }
View Full Code Here

   
    Map options = compilationUnit.getJavaProject().getOptions(true);
    TextEdit edits = rewrite.rewriteAST(document, options);
   
    // computation of the new source code
    edits.apply(document);
    String newSource = document.get();
   
    // update of the compilation unit
    compilationUnit.getBuffer().setContents(newSource);
  }
View Full Code Here

      Document document = new Document(this.document.get());

      try
      {
         TextEdit edit = unit.rewrite(document, null);
         edit.apply(document);
      }
      catch (Exception e)
      {
         throw new ParserException("Could not modify source: " + unit.toString(), e);
      }
View Full Code Here

    throws Exception
  {
    Document document = new Document(src.getBuffer().getContents());
    TextEdit edits = node.rewrite(
        document, src.getJavaProject().getOptions(true));
    edits.apply(document);
    src.getBuffer().setContents(document.get());
    if (src.isWorkingCopy()) {
        src.commitWorkingCopy(false, null);
    }
    src.save(null, false);
View Full Code Here

    TextEdit edits = formatter.format(kind, contents, offset, length, 0, delimiter);
    if (edits != null) {
      int oldLength = contents.length();
      Document document = new Document(contents);
      edits.apply(document);

      String formatted = document.get();

      // jdt formatter can introduce trailing whitespace (javadoc comments), so
      // we'll remove all trailing whitespace from the formatted section (unless
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.