I'm doing a plugin in eclipse and when I select a java class in the Package Explorer I end up getting an object of type ICompilationUnit , but I need an IResource strong>, what can be done?
I'm doing a plugin in eclipse and when I select a java class in the Package Explorer I end up getting an object of type ICompilationUnit , but I need an IResource strong>, what can be done?
try the getUnderlyingResource()
method:
public IResource obterIResourceDe(ICompilationUnit unit) {
return unit.getUnderlyingResource();
}
of the documentation Javadoc .