[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.platform] Can't check Nature of a closed project
|
If I call getDescription() on a closed project I get a ResourceException.
I have a filter that only shows projects with a particular nature.
However, if the project is closed I get the exception. Maybe there is
another way to check if a project contains a nature. Here is a snippet of
how I am doing it.
public boolean select(Viewer viewer, Object parentElement, Object element)
{
if (element instanceof Resource) {
Resource resource = (Resource) element;
try {
IProject project = resource.getProject();
if (!project.getDescription().hasNature(MY_NATURE_ID));
return(false);
else {
// do the rest of the checks
}
}
}