Mercurial > projects > dwt-addons
comparison dwtx/text/edits/TextEditProcessor.d @ 136:6dcb0baaa031
Regex removal of throws decls, some instanceof
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 24 Aug 2008 02:20:40 +0200 |
parents | 51e6e63f930e |
children | 26688fec6d23 |
comparison
equal
deleted
inserted
replaced
135:65801ad2b265 | 136:6dcb0baaa031 |
---|---|
88 private this(IDocument document, TextEdit root, int style, bool secondary) { | 88 private this(IDocument document, TextEdit root, int style, bool secondary) { |
89 Assert.isNotNull(document); | 89 Assert.isNotNull(document); |
90 Assert.isNotNull(root); | 90 Assert.isNotNull(root); |
91 fDocument= document; | 91 fDocument= document; |
92 fRoot= root; | 92 fRoot= root; |
93 if (fRoot instanceof MultiTextEdit) | 93 if ( auto mte = cast(MultiTextEdit)fRoot ) |
94 (cast(MultiTextEdit)fRoot).defineRegion(0); | 94 mte.defineRegion(0); |
95 fStyle= style; | 95 fStyle= style; |
96 if (secondary) { | 96 if (secondary) { |
97 fChecked= true; | 97 fChecked= true; |
98 fSourceEdits= new ArrayList(); | 98 fSourceEdits= new ArrayList(); |
99 } | 99 } |
189 return true; | 189 return true; |
190 } | 190 } |
191 | 191 |
192 //---- checking -------------------------------------------------------------------- | 192 //---- checking -------------------------------------------------------------------- |
193 | 193 |
194 void checkIntegrityDo() throws MalformedTreeException { | 194 void checkIntegrityDo() { |
195 fSourceEdits= new ArrayList(); | 195 fSourceEdits= new ArrayList(); |
196 fRoot.traverseConsistencyCheck(this, fDocument, fSourceEdits); | 196 fRoot.traverseConsistencyCheck(this, fDocument, fSourceEdits); |
197 if (fRoot.getExclusiveEnd() > fDocument.getLength()) | 197 if (fRoot.getExclusiveEnd() > fDocument.getLength()) |
198 throw new MalformedTreeException(null, fRoot, TextEditMessages.getString("TextEditProcessor.invalid_length")); //$NON-NLS-1$ | 198 throw new MalformedTreeException(null, fRoot, TextEditMessages.getString("TextEditProcessor.invalid_length")); //$NON-NLS-1$ |
199 } | 199 } |
203 throw new MalformedTreeException(null, fRoot, TextEditMessages.getString("TextEditProcessor.invalid_length")); //$NON-NLS-1$ | 203 throw new MalformedTreeException(null, fRoot, TextEditMessages.getString("TextEditProcessor.invalid_length")); //$NON-NLS-1$ |
204 } | 204 } |
205 | 205 |
206 //---- execution -------------------------------------------------------------------- | 206 //---- execution -------------------------------------------------------------------- |
207 | 207 |
208 UndoEdit executeDo() throws BadLocationException { | 208 UndoEdit executeDo() { |
209 UndoCollector collector= new UndoCollector(fRoot); | 209 UndoCollector collector= new UndoCollector(fRoot); |
210 try { | 210 try { |
211 if (createUndo()) | 211 if (createUndo()) |
212 collector.connect(fDocument); | 212 collector.connect(fDocument); |
213 computeSources(); | 213 computeSources(); |
231 } | 231 } |
232 } | 232 } |
233 } | 233 } |
234 } | 234 } |
235 | 235 |
236 UndoEdit executeUndo() throws BadLocationException { | 236 UndoEdit executeUndo() { |
237 UndoCollector collector= new UndoCollector(fRoot); | 237 UndoCollector collector= new UndoCollector(fRoot); |
238 try { | 238 try { |
239 if (createUndo()) | 239 if (createUndo()) |
240 collector.connect(fDocument); | 240 collector.connect(fDocument); |
241 TextEdit[] edits= fRoot.getChildren(); | 241 TextEdit[] edits= fRoot.getChildren(); |