override fun actionPerformed()

in src/main/kotlin/mobi/hsz/idea/gitignore/ui/IgnoreSettingsPanel.kt [239:264]


                        override fun actionPerformed(event: AnActionEvent) {
                            FileChooserFactory.getInstance().createSaveFileDialog(
                                FileSaverDescriptor(
                                    message("action.exportTemplates.wrapper"),
                                    "",
                                    "xml"
                                ),
                                templatesListPanel
                            ).save(null as VirtualFile?, null)?.let { wrapper ->
                                val items = currentItems
                                val document = Document(IgnoreSettings.createTemplatesElement(items))
                                runCatching {
                                    JDOMUtil.writeDocument(document, wrapper.file.outputStream(), Constants.NEWLINE)
                                    Messages.showInfoMessage(
                                        templatesListPanel,
                                        message("action.exportTemplates.success", items.size),
                                        message("action.exportTemplates.success.title")
                                    )
                                }.onFailure {
                                    Messages.showErrorDialog(
                                        templatesListPanel,
                                        message("action.exportTemplates.error")
                                    )
                                }
                            }
                        }