Mercurial > projects > dwt-addons
comparison dwtx/jface/text/FindReplaceDocumentAdapter.d @ 156:a9566845f1cb
...
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Mon, 25 Aug 2008 19:03:46 +0200 |
parents | 000f9136b8f7 |
children | 7926b636c282 |
comparison
equal
deleted
inserted
replaced
155:8442b6b2da2d | 156:a9566845f1cb |
---|---|
281 * @return the find or replace region or <code>null</code> if there was no match | 281 * @return the find or replace region or <code>null</code> if there was no match |
282 * @throws BadLocationException if startOffset is an invalid document offset | 282 * @throws BadLocationException if startOffset is an invalid document offset |
283 * @throws IllegalStateException if a REPLACE or REPLACE_FIND operation is not preceded by a successful FIND operation | 283 * @throws IllegalStateException if a REPLACE or REPLACE_FIND operation is not preceded by a successful FIND operation |
284 * @throws PatternSyntaxException if a regular expression has invalid syntax | 284 * @throws PatternSyntaxException if a regular expression has invalid syntax |
285 */ | 285 */ |
286 private IRegion findReplace(final FindReplaceOperationCode operationCode, int startOffset, String findString, String replaceText, bool forwardSearch, bool caseSensitive, bool wholeWord, bool regExSearch) { | 286 private IRegion findReplace(FindReplaceOperationCode operationCode, int startOffset, String findString, String replaceText, bool forwardSearch, bool caseSensitive, bool wholeWord, bool regExSearch) { |
287 | 287 |
288 // Validate option combinations | 288 // Validate option combinations |
289 Assert.isTrue(!(regExSearch && wholeWord)); | 289 Assert.isTrue(!(regExSearch && wholeWord)); |
290 | 290 |
291 // Validate state | 291 // Validate state |
571 * @param replaceText the original replace pattern | 571 * @param replaceText the original replace pattern |
572 * @param foundText the found pattern to be replaced | 572 * @param foundText the found pattern to be replaced |
573 * @return the new offset | 573 * @return the new offset |
574 * @since 3.4 | 574 * @since 3.4 |
575 */ | 575 */ |
576 private int interpretReplaceEscape(final char ch, int i, StringBuffer buf, String replaceText, String foundText) { | 576 private int interpretReplaceEscape(char ch, int i, StringBuffer buf, String replaceText, String foundText) { |
577 int length= replaceText.length(); | 577 int length= replaceText.length(); |
578 switch (ch) { | 578 switch (ch) { |
579 case 'r': | 579 case 'r': |
580 buf.append('\r'); | 580 buf.append('\r'); |
581 break; | 581 break; |