@Override
  public void update(@NotNull AnActionEvent e) {
    final Presentation presentation = e.getPresentation();
    presentation.setVisible(false);
    final DataContext dataContext = e.getDataContext();
    final Project project = CommonDataKeys.PROJECT.getData(dataContext);
    if (project != null) {
      final RunConfiguration configuration = RunConfiguration.DATA_KEY.getData(dataContext);
      if (isPatternBasedConfiguration(configuration)) {
        final AbstractTestProxy testProxy = AbstractTestProxy.DATA_KEY.getData(dataContext);
        if (testProxy != null) {
          final Location<?> location = testProxy.getLocation(project, ((T)configuration).getConfigurationModule().getSearchScope());
          if (location != null) {
            final PsiElement psiElement = location.getPsiElement();
            if (psiElement instanceof PsiClass && getPattern((T)configuration).contains(((PsiClass)psiElement).getQualifiedName())) {
              presentation.setVisible(true);
            }
          }
        }
      }
    }
  }
@Override
  public void update(@NotNull AnActionEvent e)