1 |
/* FileFilter.java -- |
/* FileFilter.java -- |
2 |
Copyright (C) 2002 Free Software Foundation, Inc. |
Copyright (C) 2002, 2005 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
5 |
|
|
40 |
|
|
41 |
import java.io.File; |
import java.io.File; |
42 |
|
|
43 |
|
import javax.swing.JFileChooser; |
44 |
|
|
45 |
/** |
/** |
46 |
* FileFilter |
* The base class for filters that control the visibility of files in the |
47 |
|
* {@link JFileChooser} component. |
48 |
|
* |
49 |
|
* @see JFileChooser#addChoosableFileFilter(FileFilter) |
50 |
|
* |
51 |
* @author Andrew Selkirk |
* @author Andrew Selkirk |
|
* @version 1.0 |
|
52 |
*/ |
*/ |
53 |
public abstract class FileFilter { |
public abstract class FileFilter |
54 |
|
{ |
|
//------------------------------------------------------------- |
|
|
// Initialization --------------------------------------------- |
|
|
//------------------------------------------------------------- |
|
|
|
|
|
/** |
|
|
* Constructor FileFilter |
|
|
*/ |
|
|
public FileFilter() { |
|
|
// TODO |
|
|
} // FileFilter() |
|
|
|
|
|
|
|
|
//------------------------------------------------------------- |
|
|
// Methods ---------------------------------------------------- |
|
|
//------------------------------------------------------------- |
|
|
|
|
|
/** |
|
|
* accept |
|
|
* @param file TODO |
|
|
* @returns boolean |
|
|
*/ |
|
|
public abstract boolean accept(File file); |
|
|
|
|
|
/** |
|
|
* getDescription |
|
|
* @returns String |
|
|
*/ |
|
|
public abstract String getDescription(); |
|
55 |
|
|
56 |
|
/** |
57 |
|
* Default constructor. |
58 |
|
*/ |
59 |
|
public FileFilter() { |
60 |
|
} |
61 |
|
|
62 |
|
/** |
63 |
|
* Returns <code>true</code> if the specified file matches the filter, and |
64 |
|
* <code>false</code> otherwise. |
65 |
|
* |
66 |
|
* @param file the file. |
67 |
|
* |
68 |
|
* @returns A boolean. |
69 |
|
*/ |
70 |
|
public abstract boolean accept(File file); |
71 |
|
|
72 |
|
/** |
73 |
|
* Returns a description of the files that will be selected by the filter |
74 |
|
* (for example, "Java source files"). This description will usually be |
75 |
|
* displayed on the {@link JFileChooser} component, often in a combo box that |
76 |
|
* is used to select the appropriate filter (in cases where more than one |
77 |
|
* filter is available). |
78 |
|
* |
79 |
|
* @returns A description of the filter. |
80 |
|
*/ |
81 |
|
public abstract String getDescription(); |
82 |
|
|
83 |
} // FileFilter |
} |