package utilitaires;
import java.io.File;
import javax.swing.filechooser.FileFilter;
import javax.swing.filechooser.FileNameExtensionFilter;
public class Extensions {
// image
public final static String jpeg = "jpeg";
public final static String jpg = "jpg";
public final static String gif = "gif";
public final static String tiff = "tiff";
public final static String tif = "tif";
public final static String png = "png";
// MS Office
public final static String doc = "doc";
public final static String docx = "docx";
public final static String ppt = "ppt";
public final static String pptx = "pptx";
public final static String xls = "xls";
public final static String xlsx = "xlsx";
public static FileFilter getImageExtension() {
return new FileNameExtensionFilter("Images", "bmp", "gif", "jpg",
"jpeg", "png");
}
public static FileFilter getMicorsoftExtension() {
return new FileNameExtensionFilter("MS office", "doc", "docx", "xls",
"xlxs", "ppt", "pptx");
}
public static FileFilter getProgrammingLangageExtension() {
return new FileNameExtensionFilter("Langage de programmation", "java",
"c", "cpp", "class", "cs", "vb");
}
public static FileFilter getPDFExtension() {
return new FileNameExtensionFilter("PDF", "pdf");
}
public static FileFilter getLibre_Open_OfficeExtension() {
return new FileNameExtensionFilter("LibreOffice & openOffice", "odt",
"odx");
}
public static FileFilter getSoundExtension() {
return new FileNameExtensionFilter("Music", "mp3", "midi", "mp4",
"ogg", "wav");
}
public static FileFilter getTexteExtension() {
return new FileNameExtensionFilter("Texte", "txt", "rtf");
}
public static String getFileExtensions(File f) {
return getImageExtension().accept(f) ? "image" : "fichier";
}
}