diff options
Diffstat (limited to 'src/StandardIO/MFileFilter.java')
| -rw-r--r-- | src/StandardIO/MFileFilter.java | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/StandardIO/MFileFilter.java b/src/StandardIO/MFileFilter.java new file mode 100644 index 0000000..8484806 --- /dev/null +++ b/src/StandardIO/MFileFilter.java @@ -0,0 +1,40 @@ +/* */ package StandardIO; +/* */ +/* */ import java.io.File; +/* */ +/* */ public class MFileFilter extends javax.swing.filechooser.FileFilter +/* */ { +/* */ java.io.FileFilter filter; +/* */ String description; +/* */ String[] ext; +/* */ +/* */ public MFileFilter(java.io.FileFilter f, String description) +/* */ { +/* 18 */ this.filter = f; +/* 19 */ this.description = description; +/* 20 */ this.ext = null; +/* */ } +/* */ +/* */ public MFileFilter(String[] acceptedExtensions, String description) { +/* 24 */ this.ext = acceptedExtensions; +/* 25 */ this.description = description; +/* 26 */ this.filter = null; +/* */ } +/* */ public boolean accept(File f) { +/* 29 */ if (f.isDirectory()) return true; +/* 30 */ if (this.filter != null) +/* 31 */ return this.filter.accept(f); +/* 32 */ for (String ex : this.ext) +/* 33 */ if (f.toString().endsWith(ex)) +/* 34 */ return true; +/* 35 */ return false; +/* */ } +/* */ public String getDescription() { +/* 38 */ return this.description; +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: StandardIO.MFileFilter + * JD-Core Version: 0.6.2 + */
\ No newline at end of file |