List of utility methods to do JFileChooser Filter
javax.swing.filechooser.FileFilter | getBinaryFileFilter() get Binary File Filter return getFileFilter("Einfache Speicherabbilddateien (*.bin)", "bin"); |
FileFilter | getCustomFileFilter(String desc, String[] validExtensions) get Custom File Filter final String d = desc; final String[] ext = validExtensions; return new FileFilter() { @Override public boolean accept(File f) { if (f.isDirectory()) return true; for (String e : ext) { ... |
FileNameExtensionFilter | getFileChooserFilter(java.util.List get File Chooser Filter String extensionsMsg = ""; int numExtensions = allowedExtensions.size(); String[] allowedFileExtensions = new String[numExtensions]; for (int i = 0; i < numExtensions; i++) { if (i > 0) extensionsMsg += ", "; allowedFileExtensions[i] = allowedExtensions.get(i); extensionsMsg += "*." + allowedFileExtensions[i]; ... |
javax.swing.filechooser.FileFilter | getFileFilter(String text, String... formats) get File Filter javax.swing.filechooser.FileFilter rv = null; if (formats != null) { if (formats.length > 0) { if (fmt2FileFilter == null) { fmt2FileFilter = new Hashtable<String, javax.swing.filechooser.FileFilter>(); rv = fmt2FileFilter.get(formats[0]); if (rv == null) { ... |
FileFilter | getFileFilter() Returns the file filter for this class loader. return fileFilter;
|
FileFilter | getFileFilterForExtensions(final String[] exts, final boolean ignoreCase) get File Filter For Extensions FileFilter filter = new FileFilter() { @Override public String getDescription() { StringBuilder sb = new StringBuilder(); for (int i = 0; i < exts.length; i++) { if (i != 0) { sb.append(", "); sb.append("*." + exts[i]); return sb.toString(); @Override public boolean accept(File f) { if (f == null) { return false; if (f.isDirectory()) { return true; } else if (ignoreCase) { for (int i = 0; i < exts.length; i++) { if (f.getName().toUpperCase().endsWith("." + exts[i].toUpperCase())) { return true; } else { for (int i = 0; i < exts.length; i++) { if (f.getName().endsWith("." + exts[i])) { return true; return false; }; return filter; |
String[] | getFilterExtensions(FileNameExtensionFilter... filters) get Filter Extensions return filters != null ? Arrays.stream(filters).map(filter -> filter.getExtensions()) .reduce((extensionsA, extensionsB) -> Stream .concat(Arrays.stream(extensionsA), Arrays.stream(extensionsB)).toArray(String[]::new)) .get() : null; |
ArrayList | getHostFileFilters() get Host File Filters ArrayList<FileNameExtensionFilter> filters = new ArrayList<FileNameExtensionFilter>(); filters.add(new FileNameExtensionFilter("Supported formats (*.bmp, *.png, *.tif, *.tiff)", "bmp", "png", "tif", "tiff")); return filters; |
FileFilter | getKCTapFileFilter() get KC Tap File Filter return getFileFilter("KC-TAP-Dateien (*.tap)", "tap"); |
FileFilter | getManikaFileFilter() get Manika File Filter return manikaFilter;
|