Search in sources :

Example 1 with TreePathHandle

use of org.netbeans.api.java.source.TreePathHandle in project netbeans-mmd-plugin by raydac.

the class AbstractPlugin method findFileObjectInLookup.

private Collection<? extends FileObject> findFileObjectInLookup(final Lookup lookup) {
    final Collection<? extends FileObject> files = lookup.lookupAll(FileObject.class);
    final Collection<? extends NonRecursiveFolder> folders = lookup.lookupAll(NonRecursiveFolder.class);
    final Set<FileObject> result = new HashSet<FileObject>();
    for (final NonRecursiveFolder f : folders) {
        result.add(f.getFolder());
    }
    result.addAll(files);
    final Collection<? extends TreePathHandle> treePaths = lookup.lookupAll(TreePathHandle.class);
    for (final TreePathHandle h : treePaths) {
        result.add(h.getFileObject());
    }
    return result;
}
Also used : TreePathHandle(org.netbeans.api.java.source.TreePathHandle) NonRecursiveFolder(org.netbeans.api.fileinfo.NonRecursiveFolder) FileObject(org.openide.filesystems.FileObject)

Aggregations

NonRecursiveFolder (org.netbeans.api.fileinfo.NonRecursiveFolder)1 TreePathHandle (org.netbeans.api.java.source.TreePathHandle)1 FileObject (org.openide.filesystems.FileObject)1