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 PDFFilter extends FileFilter { 33 34 37 public PDFFilter() { 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("pdf")) { 53 return true; 54 } 55 } 56 } 57 return false; 58 } 59 60 63 public String getDescription() { 64 return "PDF"; 65 } 66 67 } | Popular Tags |