public Object getAdapter(Object adaptableObject, @SuppressWarnings("rawtypes") Class adapterType) {
if (adaptableObject instanceof JavaElementDelegate) {
return ((JavaElementDelegate) adaptableObject).getAdapter(adapterType);
}
JavaElementDelegate result = null;
if (JextestJavaElementDelegate.class.equals(adapterType)) {
// make sure injection happens
result = jextestJavaElementDelegateProvider.get();
}
if (result != null) {
try {
if (adaptableObject instanceof IFileEditorInput) {
result.initializeWith((IFileEditorInput) adaptableObject);
return result;
}
if (adaptableObject instanceof IEditorPart) {
result.initializeWith((IEditorPart) adaptableObject);
return result;
}
if (adaptableObject instanceof IResource) {
result.initializeWith((IResource) adaptableObject);
return result;
}
} catch (NullPointerException e) {
// problem with @Inject in superclass
}