01: /*
02: * Enhydra Java Application Server Project
03: *
04: * The contents of this file are subject to the Enhydra Public License
05: * Version 1.1 (the "License"); you may not use this file except in
06: * compliance with the License. You may obtain a copy of the License on
07: * the Enhydra web site ( http://www.enhydra.org/ ).
08: *
09: * Software distributed under the License is distributed on an "AS IS"
10: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
11: * the License for the specific terms governing rights and limitations
12: * under the License.
13: *
14: * The Initial Developer of the Enhydra Application Server is Lutris
15: * Technologies, Inc. The Enhydra Application Server and portions created
16: * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
17: * All Rights Reserved.
18: *
19: * Contributor(s):
20: *
21: */
22: package org.enhydra.kelp.common;
23:
24: //
25:
26: import java.io.*;
27:
28: /**
29: * DirectoryFilter restricts file sets to only those files that are
30: * directories. Use this with JFileChooser to create a directory
31: * chooser.
32: *
33: *
34: * @author Slim Heilpern
35: */
36: public class DirectoryFilter extends javax.swing.filechooser.FileFilter {
37:
38: /**
39: * Create a DirectoryFilter for use with the FileChooser dialog.
40: */
41: public DirectoryFilter() {
42: }
43:
44: /**
45: * Check to see if the passed in file is a directory.
46: *
47: *
48: * @param f
49: * File to check.
50: *
51: * @return
52: * True if the file is a directory.
53: *
54: */
55: public boolean accept(File f) {
56: return f.isDirectory();
57: }
58:
59: /**
60: * Get a description of this filter.
61: *
62: * @return
63: * The description of this filter.
64: *
65: */
66: public String getDescription() {
67: return new String("Directories");
68: }
69:
70: }
|