void (@NotNull AnActionEvent e) { Presentation presentation = e.getPresentation(); DataContext context = e.getDataContext(); Project project = e.getProject(); if (project == null) { presentation.setEnabled(false); return; } PsiFile file = getFile(context, project); if (!FileTypeUtil.isSupportedFile(file)) { presentation.setEnabled(false); } }