boolean (@NotNull Project project, @NotNull PsiFile file, @Nullable Editor editor, @NotNull PsiElement startElement, @NotNull PsiElement endElement) { ActionContext context = ActionContext.from(editor, file).withElement(startElement); myPresentation = myAction.getPresentation(context); return myPresentation != null; }