[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.jdt] Re: getNonJavaResources() for default package

Take them from the package fragment root (which maps to the same folder as the default package):

((IPackageFragmentRoot) packageFragment.getParent).getNonJavaResources()

Markus


Michał Tkacz wrote:

Hi,

I'm looking for an equivalent of IPackageFragment.getNonJavaResources() that will work for default package. For some reason this case is treated separately in both implementations:

-- From PackageFragment.java:

public Object[] getNonJavaResources() throws JavaModelException {
if (this.isDefaultPackage()) {
// We don't want to show non java resources of the default package (see PR #1G58NB8)
return JavaElementInfo.NO_NON_JAVA_RESOURCES;
} else {
return ((PackageFragmentInfo) getElementInfo()).getNonJavaResources(getResource(), getPackageFragmentRoot());
}
}


-- From JarPackageFragment.java:

public Object[] getNonJavaResources() throws JavaModelException {
if (this.isDefaultPackage()) {
// We don't want to show non java resources of the default package (see PR #1G58NB8)
return JavaElementInfo.NO_NON_JAVA_RESOURCES;
} else {
return this.storedNonJavaResources();
}
}


--

I don't know what PR #1G58NB8 refers to and I don't why it is not a good idea to return non java resources of the default package.
But since I need it, I'm looking for some other way to achieve it.


Any help will be appreciated

Michał