1 19 package org.openharmonise.him.editors.filefilters; 20 21 import java.io.File ; 22 23 import javax.swing.filechooser.FileFilter ; 24 25 32 public class MovieFilter extends FileFilter { 33 34 37 public MovieFilter() { 38 super(); 39 } 40 41 44 public boolean accept(File file) { 45 if (file.isDirectory()) { 46 return true; 47 } 48 String sFilename = file.getName(); 49 if (sFilename.indexOf(".") > 0) { 50 String sExt = sFilename.substring(sFilename.indexOf(".") + 1); 51 if (sExt.length() > 0) { 52 if (sExt.equalsIgnoreCase("mpg") || sExt.equalsIgnoreCase("mpeg") || sExt.equalsIgnoreCase("mov") || sExt.equalsIgnoreCase("avi")) { 53 return true; 54 } 55 } 56 } 57 return false; 58 } 59 60 63 public String getDescription() { 64 return "Movies"; 65 } 66 67 } | Popular Tags |