package de.rico.editor.gui.filter;

import java.io.File;

import javax.swing.filechooser.FileFilter;

/**
 * A filter class for script file types that are supported by
 * the world editor.
 * @author Frank Bruns
 */
public class FilterScriptFile extends FileFilter
{

	/* (non-Javadoc)
	 * @see javax.swing.filechooser.FileFilter#accept(java.io.File)
	 */
	@Override
	public boolean accept(File file)
	{
		String filename = file.getName();
		return filename.endsWith(".bsh") || file.isDirectory();
	}

	/*
	 * (non-Javadoc)
	 * @see javax.swing.filechooser.FileFilter#getDescription()
	 */
	@Override
	public String getDescription()
	{
		return "*.bsh (beanshell script file)";
	}

}
