void (@NotNull final AnActionEvent e) { e.getPresentation().setVisible(true); e.getPresentation().setEnabled(false); final Project project = e.getData(CommonDataKeys.PROJECT); if (project != null) { Pair<Sdk, Module> sdkAndModule = PydevConsoleRunnerUtil.findPythonSdkAndModule(project, e.getData(PlatformCoreDataKeys.MODULE)); if (sdkAndModule.first != null) { e.getPresentation().setEnabled(true); } } }