0,0 → 1,67 |
/* |
* This file contains the SchemaExtensionFilter class. |
* |
* Coded by: Group 5, software practice summer 2003 |
* University of Bielefeld, Germany |
* |
* @version $Revision: 1.3 $ |
* |
* Last modification: $Date: 2003/07/14 10:58:08 $ |
* $Id: DTDExtensionFilter.java,v 1.3 2003/07/14 10:58:08 smcsporr Exp $ |
*/ |
|
package src.control; |
|
import java.io.File; |
|
/** |
* The <b><code>SchemaExtensionFilter</code></b> class is a file filter that does only |
* accept file names with the extension *.xsd or *.XSD. |
* |
* @author S. McSporran |
*/ |
public class SchemaExtensionFilter extends javax.swing.filechooser.FileFilter { |
|
ExtExtractor extractor = new ExtExtractor(); |
|
/** |
* The method accept decides whether a file will be passed by the filter. |
* |
* author S. McSporran |
* @param f: A representation of a file's name. |
* |
* Last revision: 14-Jul-2003 |
*/ |
public boolean accept(File f) { |
|
/* Accept directories. */ |
if (f.isDirectory()) { |
return true; |
} |
|
/* Get the file's extension. */ |
String extension = extractor.getExtension(f); |
|
/* Proceed if there is an extension. */ |
if (extension != null) { |
|
/* Check if the extension matches xsd.*/ |
if (extension.equals(ExtExtractor.dtd)) { |
return true; |
} |
else { |
return false; |
} |
} |
|
/* If the file does not have an extension, do not accept. */ |
return false; |
} |
|
/** |
* Implementation of the abstract <code>getDescription</code> method. |
*/ |
public String getDescription() { |
return "XML grammar files (*.xsd, *.XSD)"; |
} |
} |
Property changes: |
Added: svn:keywords |
+LastChangedDate LastChangedRevision LastChangedBy HeadURL Id |
\ No newline at end of property |