Search in sources :

Example 1 with SourceGroup

use of org.netbeans.api.project.SourceGroup in project enclojure by EricThorsen.

the class ClojureSourcesHelper method getClojureSources.

public static List<FileObject> getClojureSources(Project project) {
    List<FileObject> result = new ArrayList<FileObject>();
    Sources sources = ProjectUtils.getSources(project);
    SourceGroup[] groups = sources.getSourceGroups(Sources.TYPE_GENERIC);
    for (SourceGroup group : groups) {
        FileObject root = group.getRootFolder();
        Enumeration<? extends FileObject> files = root.getData(true);
        while (files.hasMoreElements()) {
            FileObject fobj = files.nextElement();
            if (fobj.getExt().equals(CLOJURE_EXT)) {
                result.add(fobj);
            }
        }
    }
    return result;
}
Also used : ArrayList(java.util.ArrayList) FileObject(org.openide.filesystems.FileObject) Sources(org.netbeans.api.project.Sources) SourceGroup(org.netbeans.api.project.SourceGroup)

Aggregations

ArrayList (java.util.ArrayList)1 SourceGroup (org.netbeans.api.project.SourceGroup)1 Sources (org.netbeans.api.project.Sources)1 FileObject (org.openide.filesystems.FileObject)1