void (@NotNull final AnActionEvent e) { Presentation presentation = e.getPresentation(); if (e.getProject() == null) { presentation.setEnabledAndVisible(false); return; } DataContext context = e.getDataContext(); AbstractTestProxy test = AbstractTestProxy.DATA_KEY.getData(context); TestFrameworkRunningModel model = TestTreeView.MODEL_DATA_KEY.getData(context); boolean visible = test != null && model != null && test.getLeafDiffViewerProvider() != null; presentation.setEnabled(test != null); presentation.setVisible(visible); }