public class UIBean extends java.lang.Object implements UIFace
findFiles()
, rename()
and replace()
methods execute the respective commands in a Thread on their own.Constructor and Description |
---|
UIBean(FARConfig config,
MessageBox sink)
Constructor requires a sink for (error) messages
|
Modifier and Type | Method and Description |
---|---|
void |
abort()
Aborts a currently running operation (find, replace, ...).
|
void |
addProgressListener(ProgressListener prol)
Adds a ProgressListener that will reveive notifications about find and
replace operations (but not about renaming operations).
|
java.io.File |
extract(ExtractForm criteria,
java.util.List<TargetFile> fileList)
Extracts data from the file list as defined by the criteria form and writes the result to some temporary file.
|
void |
filter(java.util.List<TargetFile> fileList,
FindFilter criteriaForm,
boolean removeMismatch)
Uses the content pattern (and associated flags) supplied with the "criteria" to filter the specified file list.
|
java.util.List<TargetFile> |
findFiles(FindFilter criteriaForm)
Uses the "criteria" parameter to configure a
FileSelector
and returns the list of found files. |
void |
removeProgressListener(ProgressListener prol)
Removes a previously set ProgressListener
|
java.util.List<TargetFile> |
rename(java.util.List<TargetFile> fileList,
OverwriteFileCallback callback)
Cycles through the file list and renames each file to the name specified in
the "newName" property, unless the file is not selected or "newName" is empty.
|
void |
replace(ReplacementDescriptor criteriaForm,
java.util.List<TargetFile> fileList)
Uses the "criteria" parameter to configure a
FileMatcher and
applies the defined relacement algorithm to all files
in the list that are marked as "selected" (the default). |
void |
reset()
Aborts any currently running search and clears the history.
|
void |
setLocalizer(Localizer localizer)
Sets the Localizer instance to be used for translations.
|
void |
undoLastReplace()
Undo command for the last replace operation.
|
public UIBean(FARConfig config, MessageBox sink)
config
- FAR configurationsink
- for (error) messagespublic java.util.List<TargetFile> findFiles(FindFilter criteriaForm)
FileSelector
and returns the list of found files.public void filter(java.util.List<TargetFile> fileList, FindFilter criteriaForm, boolean removeMismatch)
public void replace(ReplacementDescriptor criteriaForm, java.util.List<TargetFile> fileList)
FileMatcher
and
applies the defined relacement algorithm to all files
in the list that are marked as "selected" (the default).public void undoLastReplace()
undoLastReplace
in interface UIFace
public java.util.List<TargetFile> rename(java.util.List<TargetFile> fileList, OverwriteFileCallback callback)
public java.io.File extract(ExtractForm criteria, java.util.List<TargetFile> fileList)
public void abort()
public void reset()
public void setLocalizer(Localizer localizer)
localizer
- for translationspublic void addProgressListener(ProgressListener prol)
addProgressListener
in interface UIFace
prol
- ProgressListener to be added.public void removeProgressListener(ProgressListener prol)
removeProgressListener
in interface UIFace
prol
- ProgressListener to be removed