1 11 package org.eclipse.text.edits; 12 13 import org.eclipse.jface.text.BadLocationException; 14 import org.eclipse.jface.text.IDocument; 15 16 24 public final class DeleteEdit extends TextEdit { 25 26 32 public DeleteEdit(int offset, int length) { 33 super(offset, length); 34 } 35 36 39 private DeleteEdit(DeleteEdit other) { 40 super(other); 41 } 42 43 46 protected TextEdit doCopy() { 47 return new DeleteEdit(this); 48 } 49 50 53 protected void accept0(TextEditVisitor visitor) { 54 boolean visitChildren= visitor.visit(this); 55 if (visitChildren) { 56 acceptChildren(visitor); 57 } 58 } 59 60 63 int performDocumentUpdating(IDocument document) throws BadLocationException { 64 document.replace(getOffset(), getLength(), ""); fDelta= -getLength(); 66 return fDelta; 67 } 68 69 72 boolean deleteChildren() { 73 return true; 74 } 75 } 76 | Popular Tags |