Mercurial > projects > dwt-addons
comparison dwtx/text/edits/TextEdit.d @ 147:000f9136b8f7
final
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 24 Aug 2008 22:35:05 +0200 |
parents | 26688fec6d23 |
children | 5cf141e43417 |
comparison
equal
deleted
inserted
replaced
146:75302ef3f92f | 147:000f9136b8f7 |
---|---|
103 | 103 |
104 /** | 104 /** |
105 * Flags indicating that neither <code>CREATE_UNDO</code> nor | 105 * Flags indicating that neither <code>CREATE_UNDO</code> nor |
106 * <code>UPDATE_REGIONS</code> is set. | 106 * <code>UPDATE_REGIONS</code> is set. |
107 */ | 107 */ |
108 public static final int NONE= 0; | 108 public static const int NONE= 0; |
109 | 109 |
110 /** | 110 /** |
111 * Flags indicating that applying an edit tree to a document | 111 * Flags indicating that applying an edit tree to a document |
112 * is supposed to create a corresponding undo edit. If not | 112 * is supposed to create a corresponding undo edit. If not |
113 * specified <code>null</code> is returned from method <code> | 113 * specified <code>null</code> is returned from method <code> |
114 * apply</code>. | 114 * apply</code>. |
115 */ | 115 */ |
116 public static final int CREATE_UNDO= 1 << 0; | 116 public static const int CREATE_UNDO= 1 << 0; |
117 | 117 |
118 /** | 118 /** |
119 * Flag indicating that the edit's region will be updated to | 119 * Flag indicating that the edit's region will be updated to |
120 * reflect its position in the changed document. If not specified | 120 * reflect its position in the changed document. If not specified |
121 * when applying an edit tree to a document the edit's region will | 121 * when applying an edit tree to a document the edit's region will |
122 * be arbitrary. It is even not guaranteed that the tree is still | 122 * be arbitrary. It is even not guaranteed that the tree is still |
123 * well formed. | 123 * well formed. |
124 */ | 124 */ |
125 public static final int UPDATE_REGIONS= 1 << 1; | 125 public static const int UPDATE_REGIONS= 1 << 1; |
126 | 126 |
127 private static class InsertionComparator : Comparator { | 127 private static class InsertionComparator : Comparator { |
128 public int compare(Object o1, Object o2) { | 128 public int compare(Object o1, Object o2) { |
129 TextEdit edit1= cast(TextEdit)o1; | 129 TextEdit edit1= cast(TextEdit)o1; |
130 TextEdit edit2= cast(TextEdit)o2; | 130 TextEdit edit2= cast(TextEdit)o2; |
148 null, edit1, | 148 null, edit1, |
149 TextEditMessages.getString("TextEdit.overlapping")); //$NON-NLS-1$ | 149 TextEditMessages.getString("TextEdit.overlapping")); //$NON-NLS-1$ |
150 } | 150 } |
151 } | 151 } |
152 | 152 |
153 private static final TextEdit[] EMPTY_ARRAY= new TextEdit[0]; | 153 private static const TextEdit[] EMPTY_ARRAY= new TextEdit[0]; |
154 private static final InsertionComparator INSERTION_COMPARATOR= new InsertionComparator(); | 154 private static const InsertionComparator INSERTION_COMPARATOR= new InsertionComparator(); |
155 | 155 |
156 private static final int DELETED_VALUE= -1; | 156 private static const int DELETED_VALUE= -1; |
157 | 157 |
158 private int fOffset; | 158 private int fOffset; |
159 private int fLength; | 159 private int fLength; |
160 | 160 |
161 private TextEdit fParent; | 161 private TextEdit fParent; |