Java 类org.eclipse.jface.text.RewriteSessionEditProcessor 实例源码

项目:ec4e    文件:MarkerUtils.java   
/**
 * Method will apply all edits to document as single modification. Needs to
 * be executed in UI thread.
 *
 * @param document
 *            document to modify
 * @param edits
 *            list of LSP TextEdits
 */
public static void applyEdits(IDocument document, TextEdit edit) {
    if (document == null) {
        return;
    }

    IDocumentUndoManager manager = DocumentUndoManagerRegistry.getDocumentUndoManager(document);
    if (manager != null) {
        manager.beginCompoundChange();
    }
    try {
        RewriteSessionEditProcessor editProcessor = new RewriteSessionEditProcessor(document, edit,
                org.eclipse.text.edits.TextEdit.NONE);
        editProcessor.performEdits();
    } catch (MalformedTreeException | BadLocationException e) {
        EditorConfigPlugin.logError(e);
    }
    if (manager != null) {
        manager.endCompoundChange();
    }
}
项目:che    文件:DocumentAdapter.java   
public void run() {
  try {
    if (!isClosed()) {
      fUndoEdit =
          new RewriteSessionEditProcessor(
                  fDocument, fEdit, TextEdit.UPDATE_REGIONS | TextEdit.CREATE_UNDO)
              .performEdits();
    }
  } catch (BadLocationException x) {
    // ignore
  }
}
项目:Eclipse-Postfix-Code-Completion    文件:DocumentAdapter.java   
public void run() {
    try {
        if (!isClosed()) {
            fUndoEdit= new RewriteSessionEditProcessor(fDocument, fEdit, TextEdit.UPDATE_REGIONS | TextEdit.CREATE_UNDO).performEdits();
        }
    } catch (BadLocationException x) {
        // ignore
    }
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:DocumentAdapter.java   
public void run() {
    try {
        if (!isClosed()) {
            fUndoEdit= new RewriteSessionEditProcessor(fDocument, fEdit, TextEdit.UPDATE_REGIONS | TextEdit.CREATE_UNDO).performEdits();
        }
    } catch (BadLocationException x) {
        // ignore
    }
}