resource = (IResource) element;
} else if (element instanceof IAdaptable) {
final IAdaptable adaptable = (IAdaptable) element;
resource = (IResource) adaptable.getAdapter(IResource.class);
if (resource == null) {
final IContributorResourceAdapter adapter = (IContributorResourceAdapter) adaptable
.getAdapter(IContributorResourceAdapter.class);
if (adapter != null)
resource = adapter.getAdaptedResource(adaptable);
}
}
return resource;
}