@Override
  public void invoke(@NotNull final Project project, PsiElement @NotNull [] elements, DataContext dataContext) {
    if (elements.length != 1) return;

    myProject = project;

    PsiElement element = elements[0];

    if (element instanceof GrTypeDefinition aClass) {
      invokeImpl(project, dataContext, aClass, null);
    }
    else if (element instanceof GrMethod || element instanceof GrField) {
      GrTypeDefinition aClass = (GrTypeDefinition)((GrMember)element).getContainingClass();
      invokeImpl(project, dataContext, aClass, element);
    }
  }
@Override
  public void invoke(@NotNull final Project project, PsiElement @NotNull [] elements, DataContext dataContext)