0,0 → 1,66 |
/* |
* This file contains the DTDExtensionFilter class. |
* |
* Coded by: Group 5, software practice summer 2003 |
* University of Bielefeld, Germany |
* |
* @version $Revision: 1.7 $ |
* |
* Last modification: $Date: 2003/07/13 15:28:22 $ |
*/ |
|
package src.control; |
|
import java.io.File; |
|
/** |
* The DTDExtensionFilter class is a file filter that does only |
* accept file names with the extension *.dtd or *.DTD. |
* |
* @author S. McSporran |
*/ |
public class DTDExtensionFilter 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: 11-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 dtd.*/ |
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 getDescription method. |
*/ |
public String getDescription() { |
return "XML grammar files (*.dtd, *.DTD, *.xsd, *.XSD)"; |
} |
} |
Property changes: |
Added: svn:keywords |
+LastChangedDate LastChangedRevision LastChangedBy HeadURL Id |
\ No newline at end of property |