}
private Collection<String> findPackages(ISigilProjectModel project)
{
final IContentTypeManager contentTypeManager = Platform.getContentTypeManager();
final IContentType javaContentType = contentTypeManager.getContentType("org.eclipse.jdt.core.javaSource");
final HashSet<String> packages = new HashSet<String>();
try
{
project.getProject().accept(new IResourceVisitor()
{
public boolean visit(IResource resource) throws CoreException
{
if (resource instanceof IFile)
{
IFile f = (IFile) resource;
IContentType ct = contentTypeManager.findContentTypeFor(f.getName());
if (ct != null && ct.isKindOf(javaContentType))
{
ICompilationUnit cu = (ICompilationUnit) JavaCore.create(f);
IPackageFragment pf = (IPackageFragment) cu.getAncestor(IJavaElement.PACKAGE_FRAGMENT);
packages.add(pf.getElementName());
}