[Schmitzm-commits] r1690 - trunk/schmitzm-core/src/main/java/de/schmitzm/swing

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Aug 26 00:43:30 CEST 2011


Author: alfonx
Date: 2011-08-26 00:43:28 +0200 (Fri, 26 Aug 2011)
New Revision: 1690

Modified:
   trunk/schmitzm-core/src/main/java/de/schmitzm/swing/FileExtensionFilter.java
Log:
Weiterer Konstruktor in FileExtensionFilter um direkt aus einem Swing-Filtetr zu erstellen.

Modified: trunk/schmitzm-core/src/main/java/de/schmitzm/swing/FileExtensionFilter.java
===================================================================
--- trunk/schmitzm-core/src/main/java/de/schmitzm/swing/FileExtensionFilter.java	2011-08-25 15:13:19 UTC (rev 1689)
+++ trunk/schmitzm-core/src/main/java/de/schmitzm/swing/FileExtensionFilter.java	2011-08-25 22:43:28 UTC (rev 1690)
@@ -3,6 +3,7 @@
 import java.io.File;
 
 import javax.swing.filechooser.FileFilter;
+import javax.swing.filechooser.FileNameExtensionFilter;
 
 import de.schmitzm.io.IOUtil;
 import de.schmitzm.lang.LangUtil;
@@ -43,6 +44,13 @@
 	}
 
 	/**
+	 * Creates a new filter based on a Swing FileNameExtensionFilter extensions.
+	 */ 
+	public FileExtensionFilter(FileNameExtensionFilter filter) {
+		this(filter.getDescription(), false, filter.getExtensions());
+	}
+
+	/**
 	 * Tests whether a file satisfies the filter.
 	 * 
 	 * @return {@code true} if the file is a directory (so that directories are



More information about the Schmitzm-commits mailing list