void (@NotNull AnActionEvent event) { Presentation presentation = event.getPresentation(); DataContext dataContext = event.getDataContext(); ExporterToTextFile exporterToTextFile = getExporter(dataContext); presentation.setEnabledAndVisible(event.getProject() != null && exporterToTextFile != null && exporterToTextFile.canExport()); }