Package org.eclipse.jface.text
Interface IFindReplaceTargetExtension3
public interface IFindReplaceTargetExtension3
Extension interface for
IFindReplaceTarget.
Extends the find replace target's findAndSelect and
replaceSelection methods to allow and be aware of regular
expression find/replace.
- Since:
- 3.0
-
Method Summary
Modifier and TypeMethodDescriptionintfindAndSelect(int offset, String findString, boolean searchForward, boolean caseSensitive, boolean wholeWord, boolean regExSearch) Searches for a string starting at the given offset and using the specified search directives.voidreplaceSelection(String text, boolean regExReplace) Replaces the currently selected range of characters with the given text.
-
Method Details
-
findAndSelect
int findAndSelect(int offset, String findString, boolean searchForward, boolean caseSensitive, boolean wholeWord, boolean regExSearch) Searches for a string starting at the given offset and using the specified search directives. If a string has been found it is selected and its start offset is returned. If regExSearch istruethe findString is interpreted as a regular expression.- Parameters:
offset- the offset at which searching startsfindString- the specification of what should be foundsearchForward-truesearches forward,falsebackwardscaseSensitive-trueperforms a case sensitive search,falsean insensitive searchwholeWord- iftrueonly occurrences are reported in which the findString stands as a word by itself. Must not be used in combination withregExSearch.regExSearch- iftruefindString represents a regular expression Must not be used in combination withwholeWord.- Returns:
- the position of the specified string, or -1 if the string has not been found
- Throws:
PatternSyntaxException- if regExSearch istrueand findString is an invalid regular expression
-
replaceSelection
Replaces the currently selected range of characters with the given text. If regExReplace istruethe text is interpreted as a regular expression that is used to process the selected text in order to produce the actual replacement of the selected text.This target must be editable. Otherwise nothing happens.
- Parameters:
text- the specification of the substitution textregExReplace- iftruetext represents a regular expression- Throws:
IllegalStateException- in case of regular expressions, this call is not preceded by a call tofindAndSelectPatternSyntaxException- if regExReplace istrueand text is an invalid regular expression
-