void (@NotNull AnActionEvent e) { if (LocalHistoryImpl.getInstanceImpl().isDisabled()) { e.getPresentation().setEnabledAndVisible(false); return; } Project project = e.getProject(); LocalHistoryFacade vcs = getVcs(); IdeaGateway gateway = getGateway(); e.getPresentation().setEnabled(project != null && vcs != null && gateway != null); e.getPresentation().setVisible(project != null); }