public class DocumentSearchData
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
boolean |
doFindNext(javax.swing.text.JTextComponent target)
Performs a FindNext operation on the given text component.
|
boolean |
doFindNext(javax.swing.text.JTextComponent target,
boolean isReplace) |
boolean |
doFindPrev(javax.swing.text.JTextComponent target)
Finds the previous match
|
void |
doReplace(javax.swing.text.JTextComponent target,
java.lang.String replacement)
Replaces single occurrence of match with the replacement.
|
void |
doReplaceAll(javax.swing.text.JTextComponent target,
java.lang.String replacement)
Performs a replace all operation on the given component.
|
static DocumentSearchData |
getFromEditor(javax.swing.text.JTextComponent target)
Gets the Search data from a Document.
|
java.util.regex.Pattern |
getPattern() |
boolean |
isWrap() |
void |
msgNotFound(java.awt.Component target)
Displays an OptionPane dialog that the search string is not found
|
void |
setPattern(java.util.regex.Pattern pattern)
Sets the pattern to the given compiled pattern.
|
void |
setPattern(java.lang.String pat,
boolean regex,
boolean ignoreCase)
Sets the pattern from a string and flags
|
void |
setWrap(boolean wrap) |
void |
showQuickFindDialog(javax.swing.text.JTextComponent target) |
void |
showReplaceDialog(javax.swing.text.JTextComponent target)
Shows the Find and Replace dialog for the given frame
|
public java.util.regex.Pattern getPattern()
public void setPattern(java.util.regex.Pattern pattern)
setPattern(String, boolean, boolean)public void setPattern(java.lang.String pat,
boolean regex,
boolean ignoreCase)
throws java.util.regex.PatternSyntaxException
pat - String of patternregex - true if the pattern should be a regexpignoreCase - true to ignore casejava.util.regex.PatternSyntaxExceptionpublic boolean isWrap()
public void setWrap(boolean wrap)
public static DocumentSearchData getFromEditor(javax.swing.text.JTextComponent target)
target - JTextCOmponent we are attaching topublic void doReplaceAll(javax.swing.text.JTextComponent target,
java.lang.String replacement)
public void doReplace(javax.swing.text.JTextComponent target,
java.lang.String replacement)
public boolean doFindPrev(javax.swing.text.JTextComponent target)
public boolean doFindNext(javax.swing.text.JTextComponent target)
public boolean doFindNext(javax.swing.text.JTextComponent target,
boolean isReplace)
public void msgNotFound(java.awt.Component target)
public void showReplaceDialog(javax.swing.text.JTextComponent target)
public void showQuickFindDialog(javax.swing.text.JTextComponent target)