Statistics
| Revision:

root / branches / v2_0_0_prep / applications / appgvSIG / src / com / iver / cit / gvsig / project / documents / table / TableFileFilter.java @ 24923

History | View | Annotate | Download (1.76 KB)

1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2005 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 */
19
package com.iver.cit.gvsig.project.documents.table;
20

    
21
import java.io.File;
22

    
23
import javax.swing.filechooser.FileFilter;
24

    
25
import org.gvsig.fmap.dal.DataStoreParameters;
26

    
27
/**
28
 * Clase para definir que ficheros aceptara el filtro de tablas, es necesario
29
 * para el JFileChooser
30
 *
31
 * @version 05/09/2007
32
 * @author BorSanZa - Borja S?nchez Zamorano (borja.sanchez@iver.es)
33
 */
34
public class TableFileFilter extends FileFilter {
35
        public FileStoreParameters params = null;
36

    
37
    public TableFileFilter(FileStoreParameters params) {
38
            this.params = params;
39
    }
40

    
41
    /**
42
     * @see javax.swing.filechooser.FileFilter#accept(java.io.File)
43
     */
44
    public boolean accept(File f) {
45
            if (f.isDirectory()) {
46
                        return true;
47
                }
48
                return (params).fileAccept(f);
49
    }
50

    
51
    /**
52
     * @see javax.swing.filechooser.FileFilter#getDescription()
53
     */
54
    public String getDescription() {
55
            return ((DataStoreParameters)params).getDescription();
56
    }
57
}