Subversion Repositories general

Compare Revisions

No changes between revisions

Ignore whitespace Rev 356 → Rev 357

/sun/xmleditor/trunk/src/control/XMLExtensionFilter.java
0,0 → 1,57
package src.control;
 
/** This file contains the XMLExtensionFilter class.
*
* @author S. McSporran
*
* @version $Revision: 1.00
*
* Last modification: $Date: 2003/07/11 12:20:03 $
*
*/
 
import java.io.File;
 
/** The XMLExtensionFilter class is a file filter that does only
* accept file names with the extension *.xml or *.XML.
*
* @author S. McSporran
*/
public class XMLExtensionFilter extends javax.swing.filechooser.FileFilter {
 
/** 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 = ExtExtractor.getExtension(f);
/* Proceed if there is an extension. */
if (extension != null) {
/* Check if the extension matches xml.*/
if (extension.equals(ExtExtractor.xml)) {
return true;
}
else {
return false;
}
}
return false;
}
 
/* Implementation of the abstract getDescription method. */
public String getDescription() {
return "Only xml/XML files.";
}
}
Property changes:
Added: svn:keywords
+LastChangedDate LastChangedRevision LastChangedBy HeadURL Id
\ No newline at end of property