code: public List<JavaResource> getProjectEnums(Project project)
     {
        final List<JavaResource> enums = new ArrayList<>();
        if (project != null)
        {
           project.getFacet(JavaSourceFacet.class).visitJavaSources(new JavaResourceVisitor()
           {
              @Override
              public void visit(VisitContext context, JavaResource resource)
              {
                 try
                 {
                    JavaSource<?> javaSource = resource.getJavaType();
                    if (javaSource.isEnum())
                    {
                       enums.add(resource);
                    }
                 }
                 catch (ResourceException | FileNotFoundException e)
                 {
                    // ignore
                 }
              }
           });
        }
        return enums;
     }
docs: Returns all the {@link JavaEnumSource} objects from the given {@link Project}