public class ExtractForm extends FARForm implements java.beans.PropertyChangeListener
FindForm
by means of its quality as PropertyChangeListener
.LB_REGEX, regexPattern
BD_PROPERTY_NAME_SEARCH_STRING, groupReference, PROPERTY_NAME_BASEDIR
Constructor and Description |
---|
ExtractForm()
Constructor for an ExtractForm.
|
Modifier and Type | Method and Description |
---|---|
void |
addSearchStringContentListener(java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener that gets informed whenever the search string changes.
|
ExtractForm |
clone()
Returns a copy of this object.
|
boolean |
equals(java.lang.Object o)
Only the base directory is taken into account for equals!
|
java.util.regex.Pattern |
getContentPatternAsRegex()
Returns the specified content pattern string as a java regex object.
|
int |
getLeadingContext()
Return the n lines preceding the match if 'wholeLines' is set to true.
|
java.lang.String |
getMatchSeparator()
The String that should be used to separate matches.
|
int |
getTrailingContext()
Return the n lines following the match if 'wholeLines' is set to true.
|
int |
hashCode()
Only the base directory is taken into account for the hash code!
|
boolean |
isAddFileInfo()
Returns true if each block of matches from a single file should
be started with an extra line, holding the file name.
|
boolean |
isAddLineNumbers()
Returns true if line number should be prepended to the extracted matches.
|
boolean |
isPrintMatchCount()
Should the number of matches per file be printed.
|
boolean |
isPrintMatches()
Should the actual matches be printed?
Otherwise only meta information may be printed
|
boolean |
isUseSeparator()
Returns true if some separator should be used.
|
boolean |
isWholeLines()
Returns true if the extracted text should comprise the entire
line holding the match.
|
void |
propertyChange(java.beans.PropertyChangeEvent evt)
Listens to changes of the baseDirectory property value.
|
void |
reset()
Resets this form to its default state.
|
void |
setAddFileInfo(boolean addFileInfo)
True if each block of matches from a single file should
be started with an extra line, holding the file name.
|
void |
setAddLineNumbers(boolean addLineNumbers)
Set to true if line number should be prepended to the extracted matches.
|
void |
setLeadingContext(int leadingContext)
Set the number of lines preceding a match that should be returned.
|
void |
setMatchSeparator(java.lang.String matchSeparator)
The String that should be used to separate matches.
|
void |
setPrintMatchCount(boolean printMatchCount)
Set to true if the number of matches per file should be printed.
|
void |
setPrintMatches(boolean printMatches)
Set to true to print the actua matches.
|
void |
setSearchStringContent(java.lang.String searchRegexString)
Overrides the super implementation to fire a property change event.
|
void |
setTrailingContext(int trailingContext)
Set the number of lines following a match that should be returned.
|
void |
setWholeLines(boolean wholeLines)
Set to true to extract the entire line where the match occurs.
|
void |
update(ExtractForm form)
Updates this form with the data from the "form" parameter.
|
getSearchStringContent, isIgnoreCase, isRegexContentPattern, setIgnoreCase, setRegexContentPattern, update
addFormUpdateListener, addPropertyChangeListener, firePropertyChangeEvent, getBaseDirectory, getGroupReference, getType, removeFormUpdateListener, removePropertyChangeListener, setBaseDirectory, setGroupReference, update
public java.util.regex.Pattern getContentPatternAsRegex()
getContentPatternAsRegex
in class FARForm
java.util.regex.PatternSyntaxException
- if the pattern can not be
compiled into a regular expression.public java.lang.String getMatchSeparator()
public boolean isUseSeparator()
public void setMatchSeparator(java.lang.String matchSeparator)
matchSeparator
- String used for the line separating matches or null for no separator linepublic boolean isAddFileInfo()
public void setAddFileInfo(boolean addFileInfo)
addFileInfo
- true to include file name into match listpublic boolean isWholeLines()
public void setWholeLines(boolean wholeLines)
wholeLines
- true if entire lines must be extractedpublic boolean isAddLineNumbers()
public void setAddLineNumbers(boolean addLineNumbers)
addLineNumbers
- true to print line numberspublic int getLeadingContext()
public void setLeadingContext(int leadingContext)
leadingContext
- number of preceding lines to be returned for each matchpublic int getTrailingContext()
public void setTrailingContext(int trailingContext)
trailingContext
- number of trailing lines to be returned for each matchpublic boolean isPrintMatchCount()
public void setPrintMatchCount(boolean printMatchCount)
printMatchCount
- true if the number of matches per file should be printedpublic boolean isPrintMatches()
public void setPrintMatches(boolean printMatches)
printMatches
- print match resultspublic void setSearchStringContent(java.lang.String searchRegexString)
setSearchStringContent
in class FARForm
searchRegexString
- content pattern (ignores null)public void addSearchStringContentListener(java.beans.PropertyChangeListener listener)
listener
- to be registeredpublic void update(ExtractForm form)
form
- data to replace the content of this formpublic void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange
in interface java.beans.PropertyChangeListener
evt
- property change eventpublic void reset()
public ExtractForm clone()
OperationForm
clone
in class OperationForm
Object.clone()
public boolean equals(java.lang.Object o)