1 19 20 package org.openharmonise.him.editors.filefilters; 21 22 import java.io.File ; 23 24 import javax.swing.filechooser.FileFilter ; 25 26 33 public class XMLFilter extends FileFilter { 34 35 public static final String DESCRIPTION = "XML"; 36 37 40 public XMLFilter() { 41 super(); 42 } 43 44 47 public boolean accept(File file) { 48 if (file.isDirectory()) { 49 return true; 50 } 51 String sFilename = file.getName(); 52 if (sFilename.indexOf(".") > 0) { 53 String sExt = sFilename.substring(sFilename.indexOf(".") + 1); 54 if (sExt.length() > 0) { 55 if (sExt.equalsIgnoreCase("xml")) { 56 return true; 57 } 58 } 59 } 60 return false; 61 } 62 63 66 public String getDescription() { 67 return DESCRIPTION; 68 } 69 70 } 71 | Popular Tags |