public class DocumentSearchData
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
boolean |
doFindNext(javax.swing.text.JTextComponent target)
Perform a FindNext operation on the given text component.
|
boolean |
doFindPrev(javax.swing.text.JTextComponent target)
FInd the previous match
|
void |
doReplace(javax.swing.text.JTextComponent target,
java.lang.String replacement)
Replace single occurrence of match with the replacement.
|
void |
doReplaceAll(javax.swing.text.JTextComponent target,
java.lang.String replacement)
Perform a replace all operation on the given component.
|
static DocumentSearchData |
getFromEditor(javax.swing.text.JTextComponent target)
Get the Search data from a Document.
|
java.util.regex.Pattern |
getPattern() |
boolean |
isWrap() |
void |
msgNotFound(java.awt.Component target)
Display an OptionPane dialog that the search string is not found
|
void |
setPattern(java.util.regex.Pattern pattern)
Set 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)
Show the Find and Replace dialog for the given frame
|
public java.util.regex.Pattern getPattern()
public void setPattern(java.util.regex.Pattern pattern)
pattern
- this#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.PatternSyntaxException
public 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)
target
- replacement
- public void doReplace(javax.swing.text.JTextComponent target, java.lang.String replacement)
target
- replacement
- public boolean doFindPrev(javax.swing.text.JTextComponent target)
target
- public boolean doFindNext(javax.swing.text.JTextComponent target)
target
- public void msgNotFound(java.awt.Component target)
target
- public void showReplaceDialog(javax.swing.text.JTextComponent target)
target
- public void showQuickFindDialog(javax.swing.text.JTextComponent target)