private static String edit(String string, List positions, TextEdit edit) throws CoreException { TextBuffer textBuffer= TextBuffer.create(string); TextBufferEditor editor= new TextBufferEditor(textBuffer); addEdits(editor, positions); editor.add(edit); editor.performEdits(null);
private static String edit(String string, List positions, TextEdit edit) throws BadLocationException { MultiTextEdit root= new MultiTextEdit(0, string.length()); root.addChildren((TextEdit[]) positions.toArray(new TextEdit[positions.size()])); root.addChild(edit); IDocument document= new Document(string); root.apply(document);
	private static String edit(String string, List positions, TextEdit edit) throws CoreException {	    TextBuffer textBuffer= TextBuffer.create(string);		TextBufferEditor editor= new TextBufferEditor(textBuffer);		addEdits(editor, positions);		editor.add(edit);		editor.performEdits(null);				return textBuffer.getContent();	}