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