@ javax . annotation . CheckForNull public static IResource getResource ( Object element ) { if ( element instanceof IJavaElement ) { return ( ( IJavaElement ) element ) . getResource ( ) ; } return Util . getAdapter ( IResource . class , element ) ; }
Convenient method to get resources from adaptables