comparison dwtx/text/edits/MoveSourceEdit.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 5cf141e43417
comparison
equal deleted inserted replaced
135:65801ad2b265 136:6dcb0baaa031
227 } 227 }
228 } 228 }
229 return result; 229 return result;
230 } 230 }
231 231
232 void performConsistencyCheck(TextEditProcessor processor, IDocument document) throws MalformedTreeException { 232 void performConsistencyCheck(TextEditProcessor processor, IDocument document) {
233 if (fTarget is null) 233 if (fTarget is null)
234 throw new MalformedTreeException(getParent(), this, TextEditMessages.getString("MoveSourceEdit.no_target")); //$NON-NLS-1$ 234 throw new MalformedTreeException(getParent(), this, TextEditMessages.getString("MoveSourceEdit.no_target")); //$NON-NLS-1$
235 if (fTarget.getSourceEdit() !is this) 235 if (fTarget.getSourceEdit() !is this)
236 throw new MalformedTreeException(getParent(), this, TextEditMessages.getString("MoveSourceEdit.different_source")); //$NON-NLS-1$ 236 throw new MalformedTreeException(getParent(), this, TextEditMessages.getString("MoveSourceEdit.different_source")); //$NON-NLS-1$
237 /* Causes AST rewrite to fail 237 /* Causes AST rewrite to fail
284 return TextEdit.NONE; 284 return TextEdit.NONE;
285 } 285 }
286 286
287 //---- document updating ---------------------------------------------------------------- 287 //---- document updating ----------------------------------------------------------------
288 288
289 int performDocumentUpdating(IDocument document) throws BadLocationException { 289 int performDocumentUpdating(IDocument document) {
290 document.replace(getOffset(), getLength(), ""); //$NON-NLS-1$ 290 document.replace(getOffset(), getLength(), ""); //$NON-NLS-1$
291 fDelta= -getLength(); 291 fDelta= -getLength();
292 return fDelta; 292 return fDelta;
293 } 293 }
294 294
305 305
306 private bool needsTransformation() { 306 private bool needsTransformation() {
307 return fModifier !is null; 307 return fModifier !is null;
308 } 308 }
309 309
310 private void applyTransformation(IDocument document, int style) throws MalformedTreeException { 310 private void applyTransformation(IDocument document, int style) {
311 if ((style & TextEdit.UPDATE_REGIONS) !is 0 && fSourceRoot !is null) { 311 if ((style & TextEdit.UPDATE_REGIONS) !is 0 && fSourceRoot !is null) {
312 Map editMap= new HashMap(); 312 Map editMap= new HashMap();
313 TextEdit newEdit= createEdit(editMap); 313 TextEdit newEdit= createEdit(editMap);
314 List replaces= new ArrayList(Arrays.asList(fModifier.getModifications(document.get()))); 314 List replaces= new ArrayList(Arrays.asList(fModifier.getModifications(document.get())));
315 insertEdits(newEdit, replaces); 315 insertEdits(newEdit, replaces);