void (@NotNull AnActionEvent e) { String text = creator instanceof ItemPresentation ? ((ItemPresentation)creator).getPresentableText() : null; Presentation presentation = e.getPresentation(); presentation.setText(ObjectUtils.notNull(text, LangBundle.message("action.test.text"))); presentation.setEnabledAndVisible(creator.isAvailable(project, editor, file)); }