Package net.raumzeitfalle.fx.filechooser
Interface PathFilter
public interface PathFilter
The PathFilter interface is used by
FileChooserModel to provide filter predicates matching specific file types. Each PathFilter also provides a name to populate e.g. text fields in MenuItem or plain Label fields.-
Method Summary
Modifier and TypeMethodDescriptionstatic PathFilterCreates a newPathFilterwhich generally matches with all files and is named*.*.static PathFilteracceptAllFiles(String name) Creates a newPathFilterwhich generally matches with all files.default PathFiltercombine(PathFilter other) Creates a new PathFilter as a combination of the this one and any other.static PathFilterstatic PathFilterstatic PathFilterforFileExtension(String extension) Creates a newPathFilterfor file name extensions such as (.html, .xls, .xml or .pdf).static PathFilterforFileExtension(String label, String extension) Creates a newPathFilterfor file name extensions such as (.html, .xls, .xml or .pdf).getName()default booleandefault boolean
-
Method Details
-
getName
String getName()- Returns:
- A name to be used in user interface dialogs.
-
getPredicate
- Returns:
- The
Predicateto match a specific file type or a group of file types.
-
matches
-
matches
-
combine
Creates a new PathFilter as a combination of the this one and any other.- Parameters:
other-PathFilterto be combined with this one- Returns:
PathFilterwhere this onesPredicateand the othersPathFilterPredicateare combined using a logical OR.
-
acceptAllFiles
Creates a newPathFilterwhich generally matches with all files and is named*.*. This filter is intended to be used as graceful default for cases where no path filters are provided.- Returns:
PathFilter
-
acceptAllFiles
Creates a newPathFilterwhich generally matches with all files.- Parameters:
name- String value intended to be used as GUI text.- Returns:
PathFilter
-
create
-
create
-
forFileExtension
Creates a newPathFilterfor file name extensions such as (.html, .xls, .xml or .pdf). The label text will be automatically the extension with a "*." prefix so for extension txt the label will be *.txt.- Parameters:
extension-Stringthe file name extension- Returns:
- new
PathFilter
-
forFileExtension
Creates a newPathFilterfor file name extensions such as (.html, .xls, .xml or .pdf).- Parameters:
label- GUI label textextension-Stringthe file name extension- Returns:
- new
PathFilter
-