}
private void exportPreferences() {
final PersistencePreferencesBean prefs = _plugin.getState();
final VirtualFileWrapper wrapper = FileChooserFactory.getInstance().createSaveFileDialog(
new FileSaverDescriptor("Export FindBugs Preferences to File...", "", "xml"), this).save( null, null );
if (wrapper == null) return;
final Element el= XmlSerializer.serialize(prefs);
el.setName(PERSISTENCE_ROOT_NAME); // rename "PersistencePreferencesBean"
final Document document = new Document(el);
try {
JDOMUtil.writeDocument(document, wrapper.getFile(), "\n");
} catch (final IOException ex) {
LOGGER.error(ex);
final String msg = ex.getLocalizedMessage();
Messages.showErrorDialog(this, msg != null && !msg.isEmpty() ? msg : ex.toString(), "Export Failed");
}