00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 package com.meapsoft.gui;
00024
00025 import java.io.File;
00026 import javax.swing.filechooser.FileFilter;
00027
00028
00029 public class EDLFileFilter extends FileFilter {
00030
00031
00032 public boolean accept(File f) {
00033 if (f.isDirectory()) {
00034 return true;
00035 }
00036
00037 String extension = getExtension(f);
00038 if (extension != null)
00039 {
00040 if (extension.equals("edl") || extension.equals("EDL"))
00041 {
00042 return true;
00043 }
00044 else
00045 {
00046 return false;
00047 }
00048 }
00049
00050 return false;
00051 }
00052
00053
00054
00055
00056 public static String getExtension(File f) {
00057 String ext = null;
00058 String s = f.getName();
00059 int i = s.lastIndexOf('.');
00060
00061 if (i > 0 && i < s.length() - 1) {
00062 ext = s.substring(i+1).toLowerCase();
00063 }
00064 return ext;
00065 }
00066
00067
00068 public String getDescription() {
00069 return "*.edl";
00070 }
00071 }