public class SearchContext extends Object
SearchEngine methods to do the actual searching.SearchEngine| Constructor and Description |
|---|
SearchContext()
Creates a new search context.
|
SearchContext(String searchFor)
Creates a new search context.
|
SearchContext(String searchFor,
boolean matchCase)
Creates a new search context.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
getMatchCase()
Returns whether case should be honored while searching.
|
String |
getReplaceWith()
Returns the text to replace with, if doing a replace operation.
|
String |
getSearchFor()
Returns the text to search for.
|
boolean |
getSearchForward()
Returns whether the search should be forward through the text (vs.
|
boolean |
getSearchSelectionOnly()
Returns whether the search should only be done in the selected text.
|
boolean |
getWholeWord()
Returns whether only "whole word" matches should be returned.
|
boolean |
isRegularExpression()
Returns whether a regular expression search should be done.
|
void |
setMatchCase(boolean matchCase)
Sets whether case should be honored while searching.
|
void |
setRegularExpression(boolean regex)
Sets whether a regular expression search should be done.
|
void |
setReplaceWith(String replaceWith)
Sets the text to replace with, if doing a replace operation.
|
void |
setSearchFor(String searchFor)
Sets the text to search for.
|
void |
setSearchForward(boolean forward)
Sets whether the search should be forward through the text (vs.
|
void |
setSearchSelectionOnly(boolean selectionOnly)
Sets whether only the selected text should be searched.
|
void |
setWholeWord(boolean wholeWord)
Sets whether only "whole word" matches should be returned.
|
public SearchContext()
public SearchContext(String searchFor)
searchFor - The text to search for.public SearchContext(String searchFor, boolean matchCase)
searchFor - The text to search for.matchCase - Whether to do a case-sensitive search.public boolean getMatchCase()
setMatchCase(boolean)public String getReplaceWith()
setReplaceWith(String),
getSearchFor()public String getSearchFor()
setSearchFor(String),
getReplaceWith()public boolean getSearchForward()
setSearchForward(boolean)public boolean getSearchSelectionOnly()
setSearchSelectionOnly(boolean)public boolean getWholeWord()
setWholeWord(boolean)public boolean isRegularExpression()
setRegularExpression(boolean)public void setMatchCase(boolean matchCase)
matchCase - Whether case should be honored.getMatchCase()public void setRegularExpression(boolean regex)
regex - Whether a regular expression search should be done.isRegularExpression()public void setReplaceWith(String replaceWith)
replaceWith - The text to replace with.getReplaceWith(),
setSearchFor(String)public void setSearchFor(String searchFor)
searchFor - The text to search for.getSearchFor(),
setReplaceWith(String)public void setSearchForward(boolean forward)
forward - Whether we should search forwards.getSearchForward()public void setSearchSelectionOnly(boolean selectionOnly)
selectionOnly - Whether only selected text should be searched.getSearchSelectionOnly()public void setWholeWord(boolean wholeWord)
wholeWord - Whether only "whole word" matches should be returned.getWholeWord()