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
|
131
|
15 import dwtx.text.edits.MultiTextEdit; // packageimport
|
|
16 import dwtx.text.edits.CopySourceEdit; // packageimport
|
|
17 import dwtx.text.edits.MoveSourceEdit; // packageimport
|
|
18 import dwtx.text.edits.CopyingRangeMarker; // packageimport
|
|
19 import dwtx.text.edits.ReplaceEdit; // packageimport
|
|
20 import dwtx.text.edits.EditDocument; // packageimport
|
|
21 import dwtx.text.edits.UndoCollector; // packageimport
|
|
22 import dwtx.text.edits.DeleteEdit; // packageimport
|
|
23 import dwtx.text.edits.MoveTargetEdit; // packageimport
|
|
24 import dwtx.text.edits.CopyTargetEdit; // packageimport
|
|
25 import dwtx.text.edits.TextEditCopier; // packageimport
|
|
26 import dwtx.text.edits.ISourceModifier; // packageimport
|
|
27 import dwtx.text.edits.TextEditMessages; // packageimport
|
|
28 import dwtx.text.edits.TextEditProcessor; // packageimport
|
|
29 import dwtx.text.edits.MalformedTreeException; // packageimport
|
|
30 import dwtx.text.edits.TreeIterationInfo; // packageimport
|
|
31 import dwtx.text.edits.TextEditVisitor; // packageimport
|
|
32 import dwtx.text.edits.TextEditGroup; // packageimport
|
|
33 import dwtx.text.edits.TextEdit; // packageimport
|
|
34 import dwtx.text.edits.UndoEdit; // packageimport
|
|
35 import dwtx.text.edits.InsertEdit; // packageimport
|
|
36
|
|
37
|
129
|
38 import dwt.dwthelper.utils;
|
|
39
|
|
40 import dwtx.jface.text.BadLocationException;
|
|
41 import dwtx.jface.text.IDocument;
|
|
42
|
|
43 /**
|
|
44 * A range marker can be used to track positions when executing
|
|
45 * text edits.
|
|
46 *
|
|
47 * @since 3.0
|
|
48 */
|
|
49 public final class RangeMarker : TextEdit {
|
|
50
|
|
51 /**
|
|
52 * Creates a new range marker for the given offset and length.
|
|
53 *
|
|
54 * @param offset the marker's offset
|
|
55 * @param length the marker's length
|
|
56 */
|
130
|
57 public this(int offset, int length) {
|
129
|
58 super(offset, length);
|
|
59 }
|
|
60
|
|
61 /*
|
|
62 * Copy constructor
|
|
63 */
|
130
|
64 private this(RangeMarker other) {
|
129
|
65 super(other);
|
|
66 }
|
|
67
|
|
68 /*
|
|
69 * @see TextEdit#copy
|
|
70 */
|
|
71 protected TextEdit doCopy() {
|
|
72 return new RangeMarker(this);
|
|
73 }
|
|
74
|
|
75 /*
|
|
76 * @see TextEdit#accept0
|
|
77 */
|
|
78 protected void accept0(TextEditVisitor visitor) {
|
|
79 bool visitChildren= visitor.visit(this);
|
|
80 if (visitChildren) {
|
|
81 acceptChildren(visitor);
|
|
82 }
|
|
83 }
|
|
84
|
|
85 /*
|
|
86 * @see TextEdit#performDocumentUpdating
|
|
87 */
|
|
88 int performDocumentUpdating(IDocument document) throws BadLocationException {
|
|
89 fDelta= 0;
|
|
90 return fDelta;
|
|
91 }
|
|
92
|
|
93 /*
|
|
94 * @see TextEdit#deleteChildren
|
|
95 */
|
|
96 bool deleteChildren() {
|
|
97 return false;
|
|
98 }
|
|
99 }
|