Java JFileChooser Filter getKCTapFileFilter()

Here you can find the source of getKCTapFileFilter()

Description

get KC Tap File Filter

License

Open Source License

Declaration

public static FileFilter getKCTapFileFilter() 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.HashMap;
import java.util.Map;

import javax.swing.filechooser.FileFilter;
import javax.swing.filechooser.FileNameExtensionFilter;

public class Main {
    private static Map<String, FileFilter> fmt2FileFilter = null;

    public static FileFilter getKCTapFileFilter() {
        return getFileFilter("KC-TAP-Dateien (*.tap)", "tap");
    }/*from   w  ww.  java2  s  .  co m*/

    private static FileFilter getFileFilter(String text, String... formats) {
        FileFilter rv = null;
        if ((formats != null) && (text != null)) {
            if (formats.length > 0) {
                if (fmt2FileFilter == null) {
                    fmt2FileFilter = new HashMap<>();
                }
                rv = fmt2FileFilter.get(text);
                if (rv == null) {
                    rv = new FileNameExtensionFilter(text, formats);
                    fmt2FileFilter.put(text, rv);
                }
            }
        }
        return rv;
    }
}

Related

  1. getFileFilter( String text, String... formats)
  2. getFileFilter()
  3. getFileFilterForExtensions(final String[] exts, final boolean ignoreCase)
  4. getFilterExtensions(FileNameExtensionFilter... filters)
  5. getHostFileFilters()
  6. getManikaFileFilter()
  7. getMostRecentFile(File dir, java.io.FileFilter filter)
  8. getWavFileFilter()
  9. list(ArrayList list, File file, javax.swing.filechooser.FileFilter filter)