Mercurial > projects > dwt-addons
comparison dwtx/jface/text/RewriteSessionEditProcessor.d @ 140:26688fec6d23
Following dsss compile errors
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 24 Aug 2008 03:23:46 +0200 |
parents | b6bad70d540a |
children | 000f9136b8f7 |
comparison
equal
deleted
inserted
replaced
139:93a6ec48fd28 | 140:26688fec6d23 |
---|---|
167 import dwtx.text.edits.TextEditVisitor; | 167 import dwtx.text.edits.TextEditVisitor; |
168 import dwtx.text.edits.UndoEdit; | 168 import dwtx.text.edits.UndoEdit; |
169 | 169 |
170 /** | 170 /** |
171 * A text edit processor that brackets the application of edits into a document rewrite session. | 171 * A text edit processor that brackets the application of edits into a document rewrite session. |
172 * | 172 * |
173 * @since 3.3 | 173 * @since 3.3 |
174 */ | 174 */ |
175 public final class RewriteSessionEditProcessor : TextEditProcessor { | 175 public final class RewriteSessionEditProcessor : TextEditProcessor { |
176 /** The threshold for <em>large</em> text edits. */ | 176 /** The threshold for <em>large</em> text edits. */ |
177 private static final int THRESHOLD= 1000; | 177 private static final int THRESHOLD= 1000; |
208 } | 208 } |
209 } | 209 } |
210 | 210 |
211 /** | 211 /** |
212 * Constructs a new edit processor for the given document. | 212 * Constructs a new edit processor for the given document. |
213 * | 213 * |
214 * @param document the document to manipulate | 214 * @param document the document to manipulate |
215 * @param root the root of the text edit tree describing the modifications. By passing a text | 215 * @param root the root of the text edit tree describing the modifications. By passing a text |
216 * edit a a text edit processor the ownership of the edit is transfered to the text edit | 216 * edit a a text edit processor the ownership of the edit is transfered to the text edit |
217 * processors. Clients must not modify the edit (e.g adding new children) any longer. | 217 * processors. Clients must not modify the edit (e.g adding new children) any longer. |
218 * @param style {@link TextEdit#NONE}, {@link TextEdit#CREATE_UNDO} or | 218 * @param style {@link TextEdit#NONE}, {@link TextEdit#CREATE_UNDO} or |
219 * {@link TextEdit#UPDATE_REGIONS}) | 219 * {@link TextEdit#UPDATE_REGIONS}) |
220 */ | 220 */ |
221 public this(IDocument document, TextEdit root, int style) { | 221 public this(IDocument document, TextEdit root, int style) { |
222 super(document, root, style); | 222 super(document, root, style); |
223 } | 223 } |
224 | 224 |
225 /* | 225 /* |
226 * @see dwtx.text.edits.TextEditProcessor#performEdits() | 226 * @see dwtx.text.edits.TextEditProcessor#performEdits() |
227 */ | 227 */ |
228 public UndoEdit performEdits() throws MalformedTreeException, BadLocationException { | 228 public UndoEdit performEdits() { |
229 IDocument document= getDocument(); | 229 IDocument document= getDocument(); |
230 if (!( cast(IDocumentExtension4)document )) | 230 if (!( cast(IDocumentExtension4)document )) |
231 return super.performEdits(); | 231 return super.performEdits(); |
232 | 232 |
233 IDocumentExtension4 extension= cast(IDocumentExtension4) document; | 233 IDocumentExtension4 extension= cast(IDocumentExtension4) document; |
243 } | 243 } |
244 | 244 |
245 /** | 245 /** |
246 * Returns <code>true</code> if the passed edit is considered <em>large</em>, | 246 * Returns <code>true</code> if the passed edit is considered <em>large</em>, |
247 * <code>false</code> otherwise. | 247 * <code>false</code> otherwise. |
248 * | 248 * |
249 * @param edit the edit to check | 249 * @param edit the edit to check |
250 * @return <code>true</code> if <code>edit</code> is considered <em>large</em>, | 250 * @return <code>true</code> if <code>edit</code> is considered <em>large</em>, |
251 * <code>false</code> otherwise | 251 * <code>false</code> otherwise |
252 * @since 3.3 | 252 * @since 3.3 |
253 */ | 253 */ |