public class FindReplaceDocumentAdapter extends Object implements CharSequence
IDocument.
Replaces
IDocument.search(int, String, boolean, boolean, boolean).
| Constructor and Description |
|---|
FindReplaceDocumentAdapter(IDocument document)
Constructs a new find replace document adapter.
|
| Modifier and Type | Method and Description |
|---|---|
char |
charAt(int index) |
IRegion |
find(int startOffset,
String findString,
boolean forwardSearch,
boolean caseSensitive,
boolean wholeWord,
boolean regExSearch)
Returns the location of a given string in this adapter's document based on a set of search criteria.
|
int |
length() |
IRegion |
replace(String text,
boolean regExReplace)
Substitutes the previous match with the given text.
|
CharSequence |
subSequence(int start,
int end) |
String |
toString() |
public FindReplaceDocumentAdapter(IDocument document)
document - the adapted documentpublic IRegion find(int startOffset, String findString, boolean forwardSearch, boolean caseSensitive, boolean wholeWord, boolean regExSearch) throws BadLocationException
startOffset - document offset at which search startsfindString - the string to findforwardSearch - the search directioncaseSensitive - indicates whether lower and upper case should be distinguishedwholeWord - indicates whether the findString should be limited by white spaces as
defined by Character.isWhiteSpace. Must not be used in combination with regExSearch.regExSearch - if true findString represents a regular expression
Must not be used in combination with wholeWord.null if there was no matchBadLocationException - if startOffset is an invalid document offsetPatternSyntaxException - if a regular expression has invalid syntaxpublic IRegion replace(String text, boolean regExReplace) throws BadLocationException
DocumentEvent to all registered IDocumentListener.text - the substitution textregExReplace - if true text represents a regular expressionnull if there was no matchBadLocationException - if startOffset is an invalid document offsetIllegalStateException - if a REPLACE or REPLACE_FIND operation is not preceded by a successful FIND operationPatternSyntaxException - if a regular expression has invalid syntaxDocumentEvent,
IDocumentListenerpublic int length()
length in interface CharSequencepublic char charAt(int index)
charAt in interface CharSequencepublic CharSequence subSequence(int start, int end)
subSequence in interface CharSequencepublic String toString()
toString in interface CharSequencetoString in class ObjectGuidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.