Package org.eclipse.text.edits

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


        MultiTextEdit edit = new MultiTextEdit();
        edit.addChild(extractedMethodEdit.getEdit());
        edit.addChild(callExtractedMethodEdit.getEdit());

        IDocument refactoringDoc = new Document(data.source);
        edit.apply(refactoringDoc);
        return refactoringDoc;
    }

    private MockupExtractMethodRequestProcessor setupRequestProcessor(MockupExtractMethodConfig config,
            ModuleAdapter module, RefactoringInfo info) {
View Full Code Here


          int nextStart = doc.getLineOffset(line + 1);
          edit.addChild(new DeleteEdit(offset, nextStart - offset));
        }
      }
    }
    edit.apply(doc, 0);
    return doc.get();
  }

  /*
   * Don't use this method directly, use CodeGeneration.
View Full Code Here

                formatGrids(allEdits);
            } else {
                // allEdits.addChild(new InsertEdit(partition.getOffset() + partition.getLength(), lineDelimiter));
            }

            allEdits.apply(document);
        } catch (BadLocationException e) {
            e.printStackTrace();
        }
    }
View Full Code Here

      edit.addChild(astRewrite.rewriteAST());

      int oldLength = document.getLength();
      // int oldCurserPos = document.getCursorPosition();
      edit.apply(document);

      int diff = document.getLength() - oldLength;

      setCursorPosition(diff + offset);
    }
View Full Code Here

    astRewrite.getListRewrite(decl, TypeDeclaration.MODIFIERS2_PROPERTY).insertFirst(annotation, null);

    ITrackedNodePosition tracker = astRewrite.track(annotation.getTypeName());
    edit.addChild(astRewrite.rewriteAST());

    edit.apply(document);

    setReplacementOffset(tracker.getStartPosition() + annotation.getTypeName().getFullyQualifiedName().length() + 1);
  }

  @Override
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.