# HG changeset patch # Parent 7cd9aececcc115cc94889db65caab3aa3d5ca540 diff --git a/cnd.utils/nbproject/project.xml b/cnd.utils/nbproject/project.xml --- a/cnd.utils/nbproject/project.xml +++ b/cnd.utils/nbproject/project.xml @@ -14,15 +14,6 @@ - org.netbeans.modules.utilities - - - - 1 - 1.34 - - - org.openide.awt diff --git a/cnd.utils/src/org/netbeans/modules/cnd/utils/filters/CndOpenFileDialogFilter.java b/cnd.utils/src/org/netbeans/modules/cnd/utils/filters/CndOpenFileDialogFilter.java --- a/cnd.utils/src/org/netbeans/modules/cnd/utils/filters/CndOpenFileDialogFilter.java +++ b/cnd.utils/src/org/netbeans/modules/cnd/utils/filters/CndOpenFileDialogFilter.java @@ -45,9 +45,9 @@ import java.util.ArrayList; import java.util.List; import java.util.StringTokenizer; -import org.netbeans.modules.cnd.utils.FileFilterFactory; +import javax.swing.filechooser.FileFilter; import org.netbeans.modules.cnd.utils.FileFilterFactory.AbstractFileAndFileObjectFilter; -import org.netbeans.modules.openfile.OpenFileDialogFilter; +import org.openide.filesystems.FileFilterFactory; import org.openide.util.lookup.ServiceProvider; /** @@ -77,16 +77,11 @@ return res.toArray(new String[res.size()]); } - private static class Adapter extends OpenFileDialogFilter { + private static class Adapter extends FileFilter { private AbstractFileAndFileObjectFilter delegate; public Adapter(AbstractFileAndFileObjectFilter delegate) { this.delegate = delegate; - } - - @Override - public String getDescriptionString() { - return CndOpenFileDialogFilter.convertDescription(delegate.getDescription()); - } + } @Override public boolean accept(File file) { @@ -94,50 +89,70 @@ } @Override - public String[] getSuffixes() { - return CndOpenFileDialogFilter.convertSuffixes(delegate.getSuffixesAsString()); + public String getDescription() { + return FileFilterFactory.Support.constructFilterDisplayName( + convertDescription(delegate.getDescription()), + convertSuffixes(delegate.getSuffixesAsString())); } } - @ServiceProvider(service = org.netbeans.modules.openfile.OpenFileDialogFilter.class) - public static final class CFilter extends Adapter { - public CFilter() { - super(CSourceFileFilter.getInstance()); + @ServiceProvider(service = org.openide.filesystems.FileFilterFactory.class) + public static final class CFilter + implements org.openide.filesystems.FileFilterFactory { + + @Override + public FileFilter createFileFilter() { + return new Adapter(CSourceFileFilter.getInstance()); } } - @ServiceProvider(service = org.netbeans.modules.openfile.OpenFileDialogFilter.class) - public static final class CppFilter extends Adapter { - public CppFilter() { - super(CCSourceFileFilter.getInstance()); + @ServiceProvider(service = org.openide.filesystems.FileFilterFactory.class) + public static final class CppFilter + implements org.openide.filesystems.FileFilterFactory { + + @Override + public FileFilter createFileFilter() { + return new Adapter(CCSourceFileFilter.getInstance()); } } - @ServiceProvider(service = org.netbeans.modules.openfile.OpenFileDialogFilter.class) - public static final class HeaderFilter extends Adapter { - public HeaderFilter() { - super(HeaderSourceFileFilter.getInstance()); + @ServiceProvider(service = org.openide.filesystems.FileFilterFactory.class) + public static final class HeaderFilter + implements org.openide.filesystems.FileFilterFactory { + + @Override + public FileFilter createFileFilter() { + return new Adapter(HeaderSourceFileFilter.getInstance()); } } - @ServiceProvider(service = org.netbeans.modules.openfile.OpenFileDialogFilter.class) - public static final class FortranFilter extends Adapter { - public FortranFilter() { - super(FortranSourceFileFilter.getInstance()); + @ServiceProvider(service = org.openide.filesystems.FileFilterFactory.class) + public static final class FortranFilter + implements org.openide.filesystems.FileFilterFactory { + + @Override + public FileFilter createFileFilter() { + return new Adapter(FortranSourceFileFilter.getInstance()); } } - @ServiceProvider(service = org.netbeans.modules.openfile.OpenFileDialogFilter.class) - public static final class ResourceFilter extends Adapter { - public ResourceFilter() { - super(ResourceFileFilter.getInstance()); + @ServiceProvider(service = org.openide.filesystems.FileFilterFactory.class) + public static final class ResourceFilter + implements org.openide.filesystems.FileFilterFactory { + + @Override + public FileFilter createFileFilter() { + return new Adapter(ResourceFileFilter.getInstance()); } } - @ServiceProvider(service = org.netbeans.modules.openfile.OpenFileDialogFilter.class) - public static final class QtFilter extends Adapter { - public QtFilter() { - super(QtFileFilter.getInstance()); + @ServiceProvider(service = org.openide.filesystems.FileFilterFactory.class) + public static final class QtFilter + implements org.openide.filesystems.FileFilterFactory { + + @Override + public FileFilter createFileFilter() { + return new Adapter(QtFileFilter.getInstance()); } } } diff --git a/java.source/nbproject/project.xml b/java.source/nbproject/project.xml --- a/java.source/nbproject/project.xml +++ b/java.source/nbproject/project.xml @@ -343,7 +343,7 @@ - 7.58 + 7.64 diff --git a/java.source/src/org/netbeans/modules/java/JavaFileFilterFactory.java b/java.source/src/org/netbeans/modules/java/JavaFileFilterFactory.java new file mode 100644 --- /dev/null +++ b/java.source/src/org/netbeans/modules/java/JavaFileFilterFactory.java @@ -0,0 +1,60 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 2012 Oracle and/or its affiliates. All rights reserved. + * + * Oracle and Java are registered trademarks of Oracle and/or its affiliates. + * Other names may be trademarks of their respective owners. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + * + * Contributor(s): + * + * Portions Copyrighted 2012 Sun Microsystems, Inc. + */ +package org.netbeans.modules.java; + +import javax.swing.filechooser.FileFilter; +import org.openide.filesystems.FileFilterFactory; +import org.openide.util.lookup.ServiceProvider; + +/** + * Open File Dialog filter for Java files. + * + * @author jhavlin + */ +@ServiceProvider(service = FileFilterFactory.class) +public class JavaFileFilterFactory implements FileFilterFactory { + + @Override + public FileFilter createFileFilter() { + return Support.createFilterForMimeType("text/x-java"); //NOI18N + } +} diff --git a/openide.filesystems/apichanges.xml b/openide.filesystems/apichanges.xml --- a/openide.filesystems/apichanges.xml +++ b/openide.filesystems/apichanges.xml @@ -49,6 +49,19 @@ Filesystems API + + + FileFilterFactory added. + + + + + Added class FileFilterFactory, that is helpful when implementing + custom file filters for Open File dialog. + + + + addRecursiveListener with a filter diff --git a/openide.filesystems/manifest.mf b/openide.filesystems/manifest.mf --- a/openide.filesystems/manifest.mf +++ b/openide.filesystems/manifest.mf @@ -2,5 +2,5 @@ OpenIDE-Module: org.openide.filesystems OpenIDE-Module-Localizing-Bundle: org/openide/filesystems/Bundle.properties OpenIDE-Module-Layer: org/openide/filesystems/resources/layer.xml -OpenIDE-Module-Specification-Version: 7.63 +OpenIDE-Module-Specification-Version: 7.64 diff --git a/openide.filesystems/src/org/openide/filesystems/FileFilterFactory.java b/openide.filesystems/src/org/openide/filesystems/FileFilterFactory.java new file mode 100644 --- /dev/null +++ b/openide.filesystems/src/org/openide/filesystems/FileFilterFactory.java @@ -0,0 +1,294 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 2012 Oracle and/or its affiliates. All rights reserved. + * + * Oracle and Java are registered trademarks of Oracle and/or its affiliates. + * Other names may be trademarks of their respective owners. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + * + * Contributor(s): + * + * Portions Copyrighted 2012 Sun Microsystems, Inc. + */ +package org.openide.filesystems; + +import java.io.File; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.swing.filechooser.FileFilter; + +/** + * Class for registering custom {@link FileFilter file filters} that will be + * used in Open File dialog. + *

Example implementation:

+ *
+ * {@literal @}{@code ServiceProvider(service=FileFilterFactory.class)
+ * public class TXTFilterFactory extends FileFilterFactory {
+ *
+ *   public FileFilter createFileFilter() {
+ *     return Support.createFilterForExtensions(, ".txt"); //NOI18N
+ *     // or return Support.createFilterForMimeType("text/plain");        //NOI18N
+ *   }
+ * }}
+ * 
+ * + * @author jhavlin, jlahoda + * @since 7.64 + */ +public interface FileFilterFactory { + + /** + * Create a new instance of {@link FileFilter}. You should use support + * method {@link Support#createFilterForMimeType(String)} or + * {@link Support#createFilterForExtensions(String, String[])} to ensure + * consistent behavior and appearance. + */ + public FileFilter createFileFilter(); + + /** + * Support methods for creating custom file filters. + */ + public static class Support { + + /** + * The logger. + */ + private static final Logger LOG = Logger.getLogger( + FileFilterFactory.class.getName()); + + /** + * Hide the default constructor. + */ + private Support() { + } + + /** + * Create file filter that accepts files of specified MIME type. + * + * @param mimeType MIME type of accepted files (e.g. "text/plain"). + */ + public static FileFilter createFilterForMimeType(String mimeType) { + return new MimeFilter(mimeType); + } + + /** + * Create file filter that accepts files with specified extensions. + * + * @param displayName Display name of the filter (e.g. "Text Files"). + * @param allowedExtensions Array of allowed extensions (e.g. {".txt", + * ".log"}) + */ + public static FileFilter createFilterForExtensions(String displayName, + String... allowedExtensions) { + return new ExtensionFilter(displayName, allowedExtensions); + } + + /** + * Construct description for {@link FileFilter} that accepts files with + * specified extension. + * + * @param displayName Human readable display name (e.g. "HTML files") + * @param extensions List of allowed extensions (e.g. {".htm", + * ".html"}). + * + * @return Display name (description) for the filter. + */ + public static String constructFilterDisplayName(String displayName, + String... extensions) { + StringBuilder sb = new StringBuilder(displayName); + sb.append(" "); //NOI18N + sb.append(Arrays.asList(extensions).toString()); + return sb.toString(); + } + + /** + * Construct description for {@link FileFilter} that accepts files of + * specified MIME type. + * + * @param mimeType MIME type of the file filter. + * + * @return Display name (description) for the filter. + * + */ + public static String constructFilterDisplayName(String mimeType) { + return constructFilterDisplayName(getMimeDisplayName(mimeType), + toExtArray(FileUtil.getMIMETypeExtensions(mimeType))); + } + + /** + * Check whether passed file is accepted by filter for specified list of + * extensions. + * + * @param file File whose extension is checked. + * @param extensions List of allowed extensions. + * + * @return True if the file ends with one of allowed extensions, false + * otherwise. + * + * @see FileFilterSupport + */ + public static boolean accept(File file, String... extensions) { + if (file != null) { + if (file.isDirectory()) { + return true; + } + for (String ext : extensions) { + if (compareSuffixes(file.getName(), ext)) { + return true; + } + } + } + return false; + } + + /** + * Check whether passed file is accepted by filter for specified MIME + * type. + * + * @param file File that is checked for a MIME type. + * @param mimeType Accepted MIME type. + * + * @return True if file {@code file} is of MIME type {@code mimeType}, + * false otherwise. + * + * @see FileFilterSupport + */ + public static boolean accept(File file, String mimeType) { + List exts = FileUtil.getMIMETypeExtensions(mimeType); + return accept(file, toExtArray(exts)); + } + + /** + * Get display name for a MIME type. + * + * @param mimeType MIME type (e.g. "java"). + * @return Display name for the MIME type (e.g. "Java Files"), or the + * MIME type itself if no display name has been set. + */ + private static String getMimeDisplayName(String mimeType) { + try { + FileObject factoriesFO = FileUtil.getConfigFile( + "Loaders/" + mimeType + "/Factories"); //NOI18N + if (factoriesFO != null) { + FileObject[] children = factoriesFO.getChildren(); + for (FileObject child : children) { + String childName = child.getNameExt(); + String displayName = FileUtil.getConfigRoot(). + getFileSystem().getStatus(). + annotateName(childName, + Collections.singleton(child)); + if (!childName.equals(displayName)) { + return displayName; + } + } + } + } catch (Exception e) { + LOG.log(Level.WARNING, null, e); + } + return mimeType; + } + + /** + * Check whether the given filename has required suffex. + */ + private static boolean compareSuffixes(String fileName, String suffix) { + return fileName.toUpperCase().endsWith(suffix.toUpperCase()); + } + + /** + * Convert a list of strings to a string array. + * + * @param listOfStrings List of extensions, without starting perios + * (e.g. "txt", "java"). + * @return Array of extensions, with starting period (e.g. ".txt", + * ".java"). + */ + private static String[] toExtArray(List listOfStrings) { + String[] array = new String[listOfStrings.size()]; + int index = 0; + for (String ext : listOfStrings) { + array[index++] = "." + ext; //NOI18N + } + return array; + } + + /** + * Type of filters returned by {@link #createFilterForMimeType(String)}. + */ + private static class MimeFilter extends FileFilter { + + private String mimeType; + + public MimeFilter(String mimeType) { + this.mimeType = mimeType; + } + + @Override + public boolean accept(File f) { + return accept(f, mimeType); + } + + @Override + public String getDescription() { + return constructFilterDisplayName(mimeType); + } + } + + /** + * Type of filters returned by + * {@link #createFilterForExtensions(String, String[])}. + */ + private static class ExtensionFilter extends FileFilter { + + private String displayName; + private String[] extensions; + + public ExtensionFilter(String displayName, String[] extensions) { + this.displayName = displayName; + this.extensions = extensions; + } + + @Override + public boolean accept(File f) { + return accept(f, extensions); + } + + @Override + public String getDescription() { + return constructFilterDisplayName(displayName, extensions); + } + } + } +} diff --git a/openide.filesystems/test/unit/src/org/openide/filesystems/FileFilterFactoryTest.java b/openide.filesystems/test/unit/src/org/openide/filesystems/FileFilterFactoryTest.java new file mode 100644 --- /dev/null +++ b/openide.filesystems/test/unit/src/org/openide/filesystems/FileFilterFactoryTest.java @@ -0,0 +1,78 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 2012 Oracle and/or its affiliates. All rights reserved. + * + * Oracle and Java are registered trademarks of Oracle and/or its affiliates. + * Other names may be trademarks of their respective owners. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + * + * Contributor(s): + * + * Portions Copyrighted 2012 Sun Microsystems, Inc. + */ +package org.openide.filesystems; + +import java.io.File; +import javax.swing.filechooser.FileFilter; +import static org.junit.Assert.*; +import org.junit.Test; + +/** + * Test default implementation of OpenFileDialogFilter. + * + * @author jhavlin + */ +public class FileFilterFactoryTest { + + private final FileFilter filter = + FileFilterFactory.Support.createFilterForExtensions( + "Custom Example Files", new String[]{".xyz", ".uvw"}); + + public FileFilterFactoryTest() { + } + + @Test + public void testAccept() { + assertTrue(filter.accept(new File("test.xyz"))); + assertTrue(filter.accept(new File("test.XYZ"))); + assertTrue(filter.accept(new File("test.uvw"))); + assertTrue(filter.accept(new File("test.UVW"))); + assertFalse(filter.accept(new File("test.java"))); + } + + @Test + public void testGetDescription() { + assertEquals( + "Custom Example Files [.xyz, .uvw]", + filter.getDescription()); + } +} diff --git a/utilities/nbproject/project.xml b/utilities/nbproject/project.xml --- a/utilities/nbproject/project.xml +++ b/utilities/nbproject/project.xml @@ -96,7 +96,7 @@ - 7.58 + 7.64
@@ -182,11 +182,9 @@ - org.netbeans.modules.cnd.utils org.netbeans.modules.utilities.project org.netbeans.modules.visualweb.gravy org.netbeans.modules.openfile - org.netbeans.modules.search diff --git a/utilities/src/org/netbeans/modules/openfile/Bundle.properties b/utilities/src/org/netbeans/modules/openfile/Bundle.properties --- a/utilities/src/org/netbeans/modules/openfile/Bundle.properties +++ b/utilities/src/org/netbeans/modules/openfile/Bundle.properties @@ -41,7 +41,6 @@ # made subject to such option by the copyright holder. # OpenFileDialogFilter -OFDFD_Java=Java Files OFDFD_Txt=Text Files # OpenFileAction diff --git a/utilities/src/org/netbeans/modules/openfile/FileChooser.java b/utilities/src/org/netbeans/modules/openfile/FileChooser.java --- a/utilities/src/org/netbeans/modules/openfile/FileChooser.java +++ b/utilities/src/org/netbeans/modules/openfile/FileChooser.java @@ -52,9 +52,9 @@ import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.filechooser.FileFilter; -import javax.swing.filechooser.FileNameExtensionFilter; import org.openide.DialogDisplayer; import org.openide.NotifyDescriptor; +import org.openide.filesystems.FileFilterFactory; import org.openide.util.Lookup; import org.openide.util.NbBundle; import org.openide.util.lookup.ServiceProvider; @@ -83,10 +83,16 @@ * @see javax.swing.JFileChooser */ public void addChoosableFileFilters() { - for (OpenFileDialogFilter f : - Lookup.getDefault().lookupAll(OpenFileDialogFilter.class)) { + // Add legacy filters + for (org.netbeans.modules.openfile.OpenFileDialogFilter f : + Lookup.getDefault().lookupAll( + org.netbeans.modules.openfile.OpenFileDialogFilter.class)) { addChoosableFileFilter(f); } + for (FileFilterFactory f : + Lookup.getDefault().lookupAll(FileFilterFactory.class)) { + addChoosableFileFilter(f.createFileFilter()); + } } @Override @@ -130,33 +136,13 @@ } } - - @ServiceProvider(service=org.netbeans.modules.openfile.OpenFileDialogFilter.class) - public static class JavaFilesFilter extends OpenFileDialogFilter { + @ServiceProvider(service = FileFilterFactory.class) + public static class TxtFileFilterFactory implements FileFilterFactory { @Override - public String getDescriptionString() { - return NbBundle.getMessage(getClass(), "OFDFD_Java"); // NOI18N + public FileFilter createFileFilter() { + String name = NbBundle.getMessage(getClass(), "OFDFD_Txt"); //NOI18N + return Support.createFilterForExtensions(name, ".txt"); //NOI18N } - - @Override - public String[] getSuffixes() { - return new String[] {".java"}; - } - - } - - @ServiceProvider(service=OpenFileDialogFilter.class) - public static class TxtFileFilter - extends OpenFileDialogFilter.ExtensionFilter { - - @Override - public FileNameExtensionFilter getFilter() { - return new FileNameExtensionFilter( - NbBundle.getMessage(getClass(), "OFDFD_Txt"), - "txt"); // NOI18N - } - - } // End of TxtFileFilter - + } // End of TxtFileFilterFactory } diff --git a/utilities/src/org/netbeans/modules/openfile/OpenFileDialogFilter.java b/utilities/src/org/netbeans/modules/openfile/OpenFileDialogFilter.java --- a/utilities/src/org/netbeans/modules/openfile/OpenFileDialogFilter.java +++ b/utilities/src/org/netbeans/modules/openfile/OpenFileDialogFilter.java @@ -47,6 +47,7 @@ import java.util.Arrays; import javax.swing.filechooser.FileFilter; import javax.swing.filechooser.FileNameExtensionFilter; +import org.openide.filesystems.FileFilterFactory; /** * {@code OpenFileDialogFilter} is an abstract class used by {@link FileChooser} @@ -107,7 +108,10 @@ * @see OpenFileDialogFilter.ExtensionFilter * * @author Victor G. Vasilyev + * + * @deprecated Use {@link FileFilter} and {@link FileFilterFactory}. */ +@Deprecated public abstract class OpenFileDialogFilter extends FileFilter { /** @@ -258,7 +262,9 @@ * @see OpenFileDialogFilter * @see FileNameExtensionFilter * + * @deprecated Use {@link FileFilter} and {@link FileFilterFactory}. */ + @Deprecated public static abstract class ExtensionFilter extends OpenFileDialogFilter { private static final char EXTENSION_SEPARATOR = '.';