getting to ProjectMember from SourceElement

Peter Wisnovsky <[email protected]> Wed, 30 Jul 2003 15:42:12 -0700
Newsgroups gmane.comp.java.netbeans.modules.projects.devel
Message-ID <[email protected]>
I have a class constructed built off a source element. I find I need
access to the project I'm in for various API calls. I used to access
the public class from the source element, then do:

            Repository repository = Repository.getDefault();
            String fileName = classElement.getName().getFullName().replace('.', '/') + ".java";
            FileObject fileObject = repository.findResource(fileName);
            if (fileObject == null)
            {
                throw new FileStateInvalidException(fileName);
            }
                
            ProjectMember dataObject = ProjectMember.find(fileObject);

However now that I'm moving to the projects world I'm finding I'm
dropping out on the file state exception because the repository is not
finding the object. Has this stuff changed?

Peter