void (@NotNull AnActionEvent e) { Presentation presentation = e.getPresentation(); Project project = e.getProject(); if (project == null) { presentation.setEnabled(false); return; } final DataContext dataContext = e.getDataContext(); Editor editor = getEditor(dataContext, project, true); if (editor == null) { presentation.setVisible(!ActionPlaces.isPopupPlace(e.getPlace())); presentation.setEnabled(false); return; } final PsiFile file = PsiUtilBase.getPsiFileInEditor(editor, project); if (file == null) { presentation.setEnabled(false); return; } update(presentation, project, editor, file, dataContext, e.getPlace()); }