2 * (c) Copyright IBM Corp. 2000, 2001.
5 package net.sourceforge.phpdt.internal.corext.textmanipulation;
7 import org.eclipse.core.runtime.CoreException;
10 * A text edit that does nothing. A <code>NopTextEdit</code> can be used to
11 * track positions when executing <code>TextEdits</code> associated with a
13 * TextBufferEditor</code>.
15 public class NopTextEdit extends TextEdit {
17 private TextRange fTextRange;
20 * Creates a new <code>NopTextEdit</code> for the given offset and length.
23 * the starting offset this text edit is "working on"
25 * the length this text edit is "working on"
27 public NopTextEdit(int offset, int length) {
28 this(new TextRange(offset, length));
32 * Creates a new <code>NopTextEdit</code> for the given range.
35 * the <code>TextRange</code> this text edit is "working on"
37 public NopTextEdit(TextRange range) {
44 * @see TextEdit#getTextRange
46 public TextRange getTextRange() {
53 * @see TextEdit#perform
55 public TextEdit perform(TextBuffer buffer) throws CoreException {
56 return new NopTextEdit(fTextRange);
62 * @see TextEdit#perform
64 public TextEdit copy() {
65 return new NopTextEdit(fTextRange.copy());