PamUtils
Class PamFileFilter
java.lang.Object
javax.swing.filechooser.FileFilter
PamUtils.PamFileFilter
- All Implemented Interfaces:
- java.io.FileFilter
public class PamFileFilter
- extends javax.swing.filechooser.FileFilter
- implements java.io.FileFilter
|
Constructor Summary |
PamFileFilter(java.lang.String description,
java.lang.String defExtension)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
extensions
private java.util.ArrayList<java.lang.String> extensions
description
private java.lang.String description
acceptFolders
private boolean acceptFolders
PamFileFilter
public PamFileFilter(java.lang.String description,
java.lang.String defExtension)
addFileType
public void addFileType(java.lang.String extString)
accept
public boolean accept(java.io.File f)
- Specified by:
accept in interface java.io.FileFilter- Specified by:
accept in class javax.swing.filechooser.FileFilter
getExtension
public static java.lang.String getExtension(java.io.File f)
checkFileEnd
public static java.io.File checkFileEnd(java.io.File f,
java.lang.String end,
boolean forceEnd)
- Checks a file end. If forceEnd is true, then the end must be of the
same type as end, otherwise, it will allow any file end, but if none
exists, will add the given default one.
- Parameters:
f - file to checkend - file end (with or without the '.')forceEnd - force it to add the end to the file name
- Returns:
- File corrected file name.
getDescription
public java.lang.String getDescription()
- Specified by:
getDescription in class javax.swing.filechooser.FileFilter
isAcceptFolders
public boolean isAcceptFolders()
setAcceptFolders
public void setAcceptFolders(boolean acceptFolders)