void (@NotNull AnActionEvent e) { Presentation presentation = e.getPresentation(); presentation.setText(IdeBundle.messagePointer("goto.custom.region.menu.item")); final Editor editor = e.getData(CommonDataKeys.EDITOR); final Project project = e.getProject(); boolean isAvailable = editor != null && project != null; presentation.setEnabledAndVisible(isAvailable); }