IJavaProject prj = (IJavaProject) parentElement;
IJavaElement[] children = prj.getChildren();
List<Object> list = new ArrayList<Object>();
for (IJavaElement jElement : children) {
if (jElement instanceof IPackageFragmentRoot) {
IPackageFragmentRoot pkgRoot = (IPackageFragmentRoot) jElement;
if (!pkgRoot.isArchive())
list.add(jElement);
}
}
return list.toArray();
} else if (parentElement instanceof IPackageFragmentRoot) {
IPackageFragmentRoot packageRoot = (IPackageFragmentRoot) parentElement;
IJavaElement[] children = packageRoot.getChildren();
Object[] nonJavaResources = packageRoot.getNonJavaResources();
List<Object> list = new ArrayList<Object>();
if (children != null) {
for (Object child : children) {
list.add(child);
}