/*
 * HTMLFileFilter
 * this class is a filter for the open and save file dialogs
 */

package icsTables;

import icsDyn.ExtUtils;

/**
*
* @author  Rob Snelick
* Extend the File Filter class so that only certain extensions are allowed with
* use in the File Chooser. Here we limit this to HTML files only.
*/
public class HTMLFileFilter extends javax.swing.filechooser.FileFilter{
	/*
	 *  
	 * @see javax.swing.filechooser.FileFilter#accept(java.io.File)
	 */
	public boolean accept(java.io.File f) {
	    
	    if (f.isDirectory()) {
	      return true;
	    }
	    String extension = ExtUtils.getExtension(f);
	    if (extension != null) {
	      if (extension.equals(ExtUtils.html)) {
	        return true;
	      } else {
	        return false;
	      }
	    }
	    return false;
	  }
	 /*
	  *  
	  * @see javax.swing.filechooser.FileFilter#getDescription()
	  */
	  public String getDescription() {
	    return ("HTML files");
	  }
}
