@Override protected void addEdits(IDocument document, TextEdit editRoot) throws CoreException { if (fResultingEdit != null) { editRoot.addChild(fResultingEdit); } }
@Override protected void addEdits(IDocument document, TextEdit editRoot) throws CoreException { if (fResultingEdit != null) { editRoot.addChild(fResultingEdit); } }
final void addEdit(TextEdit edit) { this.currentEdit.addChild(edit); }
final void addEdit(TextEdit edit) { this.currentEdit.addChild(edit); }
final void addEdit(TextEdit edit) { this.currentEdit.addChild(edit); }
private void manageCopy(TextEdit copy) { if (fResult == null) fResult= copy; if (fCurrentParent != null) { fCurrentParent.addChild(copy); } fParents.add(fCurrentParent); fCurrentParent= copy; } @Override
private void manageCopy(TextEdit copy) { if (fResult == null) fResult= copy; if (fCurrentParent != null) { fCurrentParent.addChild(copy); } fParents.add(fCurrentParent); fCurrentParent= copy; } @Override
@Override protected void addEdits(IDocument doc, TextEdit rootEdit) throws CoreException { super.addEdits(doc, rootEdit); TextEdit edit= new ReplaceEdit(fOffset, fLength, fReplacementString); rootEdit.addChild(edit); }
protected void addEdits(IDocument doc, TextEdit rootEdit) throws CoreException { super.addEdits(doc, rootEdit); TextEdit edit= new ReplaceEdit(fOffset, fLength, fReplacementString); rootEdit.addChild(edit); }
@Override protected void addEdits(IDocument doc, TextEdit rootEdit) throws CoreException { super.addEdits(doc, rootEdit); TextEdit edit= new ReplaceEdit(fOffset, fLength, fReplacementString); rootEdit.addChild(edit); }
@Override protected void addEdits(IDocument doc, TextEdit rootEdit) throws CoreException { super.addEdits(doc, rootEdit); TextEdit edit= new ReplaceEdit(fOffset, fLength, fReplacementString); rootEdit.addChild(edit); }
@Override protected void addEdits(IDocument document, TextEdit editRoot) throws CoreException { CompilationUnit astRoot = context.getASTRoot(); OrganizeImportsOperation op = new OrganizeImportsOperation(cu, astRoot, true, false, true, null); editRoot.addChild(op.createTextEdit(null)); } };
@Override protected void addEdits(IDocument document, TextEdit editRoot) throws CoreException { CompilationUnit astRoot = context.getASTRoot(); GenerateGetterSetterOperation operation = new GenerateGetterSetterOperation(type, astRoot); TextEdit textEdit = operation.createTextEdit(null); if (textEdit != null) { editRoot.addChild(textEdit); } } };
@Override protected void addEdits(IDocument document, TextEdit editRoot) throws CoreException { CompilationUnit astRoot = context.getASTRoot(); OrganizeImportsOperation op = new OrganizeImportsOperation(unit, astRoot, true, false, true, null); editRoot.addChild(op.createTextEdit(null)); } };
@Override protected void addEdits(IDocument document, TextEdit editRoot) throws CoreException { CompilationUnit astRoot = context.getASTRoot(); OrganizeImportsOperation op = new OrganizeImportsOperation(unit, astRoot, true, false, true, null); editRoot.addChild(op.createTextEdit(null)); } };
@Override protected void addEdits(IDocument document, TextEdit rootEdit) throws CoreException { super.addEdits(document, rootEdit); try { Position pos= getUpdatedPosition(document); if (pos != null) { rootEdit.addChild(new ReplaceEdit(pos.getOffset(), pos.getLength(), "")); //$NON-NLS-1$ } else { rootEdit.addChild(new ReplaceEdit(fLocation.getOffset(), fLocation.getLength(), "")); //$NON-NLS-1$ } } catch (BadLocationException e) { throw new CoreException(JavaUIStatus.createError(IStatus.ERROR, e)); } }
protected void addEdits(IDocument document, TextEdit rootEdit) throws CoreException { super.addEdits(document, rootEdit); try { Position pos= getUpdatedPosition(document); if (pos != null) { rootEdit.addChild(new ReplaceEdit(pos.getOffset(), pos.getLength(), "")); //$NON-NLS-1$ } else { rootEdit.addChild(new ReplaceEdit(fLocation.getOffset(), fLocation.getLength(), "")); //$NON-NLS-1$ } } catch (BadLocationException e) { throw new CoreException(JavaUIStatus.createError(IStatus.ERROR, e)); } }
private static void createEdit(TextEdit source, TextEdit target, Map<TextEdit, TextEdit> editMap) { TextEdit[] children= source.getChildren(); for (int i= 0; i < children.length; i++) { TextEdit child= children[i]; // a deleted child remains deleted even if the temporary buffer // gets modified. if (child.isDeleted()) continue; RangeMarker marker= new RangeMarker(child.getOffset(), child.getLength()); target.addChild(marker); editMap.put(marker, child); createEdit(child, marker, editMap); } }
private void applyTransformation(IDocument document) throws MalformedTreeException { TextEdit newEdit= new MultiTextEdit(0, document.getLength()); ReplaceEdit[] replaces= fModifier.getModifications(document.get()); for (int i= 0; i < replaces.length; i++) { newEdit.addChild(replaces[i]); } try { newEdit.apply(document, TextEdit.NONE); } catch (BadLocationException cannotHappen) { Assert.isTrue(false); } }
private void applyTransformation(IDocument document) throws MalformedTreeException { TextEdit newEdit= new MultiTextEdit(0, document.getLength()); ReplaceEdit[] replaces= fModifier.getModifications(document.get()); for (ReplaceEdit replace : replaces) { newEdit.addChild(replace); } try { newEdit.apply(document, TextEdit.NONE); } catch (BadLocationException cannotHappen) { Assert.isTrue(false); } }