1 20 21 package org.webdocwf.util.loader.wizard; 22 23 import java.io.File ; 24 25 34 public class OctopusFileFilter extends javax.swing.filechooser.FileFilter { 35 36 public static final int OLJ = 0; 37 public static final int OPF = 1; 38 int type = 0; 39 40 44 public OctopusFileFilter() { 45 this.type = 0; 46 } 47 48 51 public OctopusFileFilter(int type) { 52 this.type = type; 53 } 54 55 63 public boolean accept(File f) { 64 switch(type) { 65 case 0: 66 return f.getName().endsWith(".olj") || f.isDirectory(); 67 case 1: 68 return f.getName().endsWith(".opf") || f.isDirectory(); 69 default: 70 return f.getName().endsWith(".olj") || f.isDirectory(); 71 } 72 } 73 74 80 public String getDescription() { 81 switch(type) { 82 case 0: 83 return new String (".olj"); 84 case 1: 85 return new String (".opf"); 86 default: 87 return new String (".olj"); 88 } 89 } 90 } 91 | Popular Tags |