Mercurial > projects > dwt-addons
comparison dwtx/text/edits/CopySourceEdit.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 | f70d9508c95c |
comparison
equal
deleted
inserted
replaced
135:65801ad2b265 | 136:6dcb0baaa031 |
---|---|
160 * @param edit the new target edit. | 160 * @param edit the new target edit. |
161 * | 161 * |
162 * @exception MalformedTreeException is thrown if the target edit | 162 * @exception MalformedTreeException is thrown if the target edit |
163 * is a direct or indirect child of the source edit | 163 * is a direct or indirect child of the source edit |
164 */ | 164 */ |
165 public void setTargetEdit(CopyTargetEdit edit) throws MalformedTreeException { | 165 public void setTargetEdit(CopyTargetEdit edit) { |
166 Assert.isNotNull(edit); | 166 Assert.isNotNull(edit); |
167 if (fTarget !is edit) { | 167 if (fTarget !is edit) { |
168 fTarget= edit; | 168 fTarget= edit; |
169 fTarget.setSourceEdit(this); | 169 fTarget.setSourceEdit(this); |
170 } | 170 } |
258 } | 258 } |
259 } | 259 } |
260 return result; | 260 return result; |
261 } | 261 } |
262 | 262 |
263 void performConsistencyCheck(TextEditProcessor processor, IDocument document) throws MalformedTreeException { | 263 void performConsistencyCheck(TextEditProcessor processor, IDocument document) { |
264 if (fTarget is null) | 264 if (fTarget is null) |
265 throw new MalformedTreeException(getParent(), this, TextEditMessages.getString("CopySourceEdit.no_target")); //$NON-NLS-1$ | 265 throw new MalformedTreeException(getParent(), this, TextEditMessages.getString("CopySourceEdit.no_target")); //$NON-NLS-1$ |
266 if (fTarget.getSourceEdit() !is this) | 266 if (fTarget.getSourceEdit() !is this) |
267 throw new MalformedTreeException(getParent(), this, TextEditMessages.getString("CopySourceEdit.different_source")); //$NON-NLS-1$ | 267 throw new MalformedTreeException(getParent(), this, TextEditMessages.getString("CopySourceEdit.different_source")); //$NON-NLS-1$ |
268 /* causes ASTRewrite to fail | 268 /* causes ASTRewrite to fail |
309 | 309 |
310 private bool needsTransformation() { | 310 private bool needsTransformation() { |
311 return fModifier !is null; | 311 return fModifier !is null; |
312 } | 312 } |
313 | 313 |
314 private void applyTransformation(IDocument document) throws MalformedTreeException { | 314 private void applyTransformation(IDocument document) { |
315 TextEdit newEdit= new MultiTextEdit(0, document.getLength()); | 315 TextEdit newEdit= new MultiTextEdit(0, document.getLength()); |
316 ReplaceEdit[] replaces= fModifier.getModifications(document.get()); | 316 ReplaceEdit[] replaces= fModifier.getModifications(document.get()); |
317 for (int i= 0; i < replaces.length; i++) { | 317 for (int i= 0; i < replaces.length; i++) { |
318 newEdit.addChild(replaces[i]); | 318 newEdit.addChild(replaces[i]); |
319 } | 319 } |
324 } | 324 } |
325 } | 325 } |
326 | 326 |
327 //---- document updating ---------------------------------------------------------------- | 327 //---- document updating ---------------------------------------------------------------- |
328 | 328 |
329 int performDocumentUpdating(IDocument document) throws BadLocationException { | 329 int performDocumentUpdating(IDocument document) { |
330 fDelta= 0; | 330 fDelta= 0; |
331 return fDelta; | 331 return fDelta; |
332 } | 332 } |
333 | 333 |
334 //---- region updating ---------------------------------------------------------------- | 334 //---- region updating ---------------------------------------------------------------- |