public void actionPerformed()

in src/main/java/org/jetbrains/plugins/spotbugs/gui/settings/AdvancedSettingsAction.java [168:210]


		public void actionPerformed(@NotNull final AnActionEvent e) {

			final VirtualFileWrapper wrapper = FileChooserFactory.getInstance().createSaveFileDialog(
					new FileSaverDescriptor(
							ResourcesLoader.getString("settings.export.title"),
							ResourcesLoader.getString("settings.export.description"),
							XmlFileType.DEFAULT_EXTENSION
					), settingsPane).save("SpotBugs");
			if (wrapper == null) {
				return;
			}

			final ProjectSettings settings = new ProjectSettings();
			try {
				settingsPane.apply(settings);
				settingsPane.applyProject(settings);
			} catch (final ConfigurationException ex) {
				Messages.showErrorDialog(settingsPane, ex.getMessage(), StringUtil.capitalizeWords(ResourcesLoader.getString("settings.invalid.title"), true));
			}

			Element root = new Element("findbugs");
			new SmartSerializer().writeExternal(settings, root, false);
			try {
				final File file = wrapper.getFile();
				final File exportDirPath = file.getAbsoluteFile().getParentFile();
				ExportErrorType errorType = ExportErrorType.from(exportDirPath);
				if (errorType != null) {
					Messages.showErrorDialog(settingsPane, errorType.getText(exportDirPath), StringUtil.capitalizeWords(ResourcesLoader.getString("settings.action.export.title"), true));
					actionPerformed(e);
					return;
				}
				JDOMUtil.writeDocument(new Document(root), file, "\n");
				RevealFileAction.showDialog(
						project,
						ResourcesLoader.getString("settings.export.success.text"),
						StringUtil.capitalizeWords(ResourcesLoader.getString("settings.export.success.title"), true),
						file,
						null
				);
			} catch (final IOException ex) {
				throw ErrorUtil.toUnchecked(ex);
			}
		}