01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.text.edits;
11:
12: import org.eclipse.jface.text.BadLocationException;
13: import org.eclipse.jface.text.IDocument;
14:
15: /**
16: * A range marker can be used to track positions when executing
17: * text edits.
18: *
19: * @since 3.0
20: */
21: public final class RangeMarker extends TextEdit {
22:
23: /**
24: * Creates a new range marker for the given offset and length.
25: *
26: * @param offset the marker's offset
27: * @param length the marker's length
28: */
29: public RangeMarker(int offset, int length) {
30: super (offset, length);
31: }
32:
33: /*
34: * Copy constructor
35: */
36: private RangeMarker(RangeMarker other) {
37: super (other);
38: }
39:
40: /*
41: * @see TextEdit#copy
42: */
43: protected TextEdit doCopy() {
44: return new RangeMarker(this );
45: }
46:
47: /*
48: * @see TextEdit#accept0
49: */
50: protected void accept0(TextEditVisitor visitor) {
51: boolean visitChildren = visitor.visit(this );
52: if (visitChildren) {
53: acceptChildren(visitor);
54: }
55: }
56:
57: /*
58: * @see TextEdit#performDocumentUpdating
59: */
60: int performDocumentUpdating(IDocument document)
61: throws BadLocationException {
62: fDelta = 0;
63: return fDelta;
64: }
65:
66: /*
67: * @see TextEdit#deleteChildren
68: */
69: boolean deleteChildren() {
70: return false;
71: }
72: }
|