1. /*
  2. * @(#)FileFilter.java 1.8 01/11/29
  3. *
  4. * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.swing.filechooser;
  8. import java.io.File;
  9. /**
  10. * FileFilter is an abstract class that has no default implemention.
  11. * A FileFilter, once implemented, can be set on a JFileChooser to
  12. * keep unwanted files from appearing in the directory listing.
  13. *
  14. * A default implementation (ExtensionFileFilter) is currently in the
  15. * FileChooserDemo directory, and will become a first class swing
  16. * implementation in Swing 1.0.3.
  17. *
  18. * For an example implementation of a simple file filter, see
  19. * <code><i>yourJDK</i>/demo/jfc/FileChooserDemo/ExampleFileFilter.java</code>.
  20. * For more information, see the Swing Connection article on the
  21. * <a href="http://java.sun.com/products/jfc/swingdoc-current/file_chooser.html">File Chooser</a>
  22. *
  23. * @see javax.swing.JFileChooser#setFileFilter
  24. * @see javax.swing.JFileChooser#addChoosableFileFilter
  25. *
  26. * @version 1.8 11/29/01
  27. * @author Jeff Dinkins
  28. */
  29. public abstract class FileFilter {
  30. /**
  31. * Whether the given file is accepted by this filter.
  32. */
  33. public abstract boolean accept(File f);
  34. /**
  35. * The description of this filter. For example: "JPG and GIF Images"
  36. * @see FileView#getName
  37. */
  38. public abstract String getDescription();
  39. }