comparison dwtx/text/edits/CopyTargetEdit.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
106 * @param edit the source edit 106 * @param edit the source edit
107 * 107 *
108 * @exception MalformedTreeException is thrown if the target edit 108 * @exception MalformedTreeException is thrown if the target edit
109 * is a direct or indirect child of the source edit 109 * is a direct or indirect child of the source edit
110 */ 110 */
111 public void setSourceEdit(CopySourceEdit edit) throws MalformedTreeException { 111 public void setSourceEdit(CopySourceEdit edit) {
112 Assert.isNotNull(edit); 112 Assert.isNotNull(edit);
113 if (fSource !is edit) { 113 if (fSource !is edit) {
114 fSource= edit; 114 fSource= edit;
115 fSource.setTargetEdit(this); 115 fSource.setTargetEdit(this);
116 TextEdit parent= getParent(); 116 TextEdit parent= getParent();
159 } 159 }
160 160
161 /* 161 /*
162 * @see TextEdit#performConsistencyCheck 162 * @see TextEdit#performConsistencyCheck
163 */ 163 */
164 void performConsistencyCheck(TextEditProcessor processor, IDocument document) throws MalformedTreeException { 164 void performConsistencyCheck(TextEditProcessor processor, IDocument document) {
165 if (fSource is null) 165 if (fSource is null)
166 throw new MalformedTreeException(getParent(), this, TextEditMessages.getString("CopyTargetEdit.no_source")); //$NON-NLS-1$ 166 throw new MalformedTreeException(getParent(), this, TextEditMessages.getString("CopyTargetEdit.no_source")); //$NON-NLS-1$
167 if (fSource.getTargetEdit() !is this) 167 if (fSource.getTargetEdit() !is this)
168 throw new MalformedTreeException(getParent(), this, TextEditMessages.getString("CopyTargetEdit.different_target")); //$NON-NLS-1$ 168 throw new MalformedTreeException(getParent(), this, TextEditMessages.getString("CopyTargetEdit.different_target")); //$NON-NLS-1$
169 } 169 }
170 170
171 /* 171 /*
172 * @see TextEdit#performDocumentUpdating 172 * @see TextEdit#performDocumentUpdating
173 */ 173 */
174 int performDocumentUpdating(IDocument document) throws BadLocationException { 174 int performDocumentUpdating(IDocument document) {
175 String source= fSource.getContent(); 175 String source= fSource.getContent();
176 document.replace(getOffset(), getLength(), source); 176 document.replace(getOffset(), getLength(), source);
177 fDelta= source.length() - getLength(); 177 fDelta= source.length() - getLength();
178 fSource.clearContent(); 178 fSource.clearContent();
179 return fDelta; 179 return fDelta;