}
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings({"SIC_INNER_SHOULD_BE_STATIC_ANON", "REC_CATCH_EXCEPTION"})
private void importPreferences() {
@SuppressWarnings("AnonymousInnerClassMayBeStatic")
final FileChooserDescriptor descriptor = new FileChooserDescriptor(true, false, true, false, true, false) {
@Override
public boolean isFileVisible(final VirtualFile file, final boolean showHiddenFiles) {
return super.isFileVisible(file, showHiddenFiles) &&
(file.isDirectory() || "xml".equals(file.getExtension()) || file.getFileType() == StdFileTypes.ARCHIVE);
}
@Override
public boolean isFileSelectable(final VirtualFile file) {
return file.getFileType() == StdFileTypes.XML;
}
};
descriptor.setDescription( "Please select the configuration file (usually named findbugs.xml) to import." );
descriptor.setTitle( "Import Configuration" );
final VirtualFile [] files = FileChooser.chooseFiles(descriptor, this, getProject(), null);
if (files.length != 1) {
return;
}