aboutsummaryrefslogtreecommitdiff
path: root/src/StandardIO/MFileFilter.java
blob: 8484806b3bc42604943f809e5eacb9878415de39 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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
 */