use of org.eclipse.xtext.common.types.access.impl.IndexedJvmTypeAccess in project xtext-eclipse by eclipse.
the class JdtTypeProvider method canLink.
private boolean canLink(JvmType type) {
Resource resource = type.eResource();
if (resource instanceof TypeResource) {
IMirror mirror = ((TypeResource) resource).getMirror();
if (mirror instanceof JdtTypeMirror) {
try {
return canLink(((JdtTypeMirror) mirror).getMirroredType());
} catch (JavaModelException e) {
return false;
}
} else {
return true;
}
}
URI resourceURI = resource.getURI();
if (resourceURI.isPlatformResource() && resourceURI.segment(1).equals(javaProject.getProject().getName())) {
IndexedJvmTypeAccess indexedJvmTypeAccess = this.getIndexedJvmTypeAccess();
if (indexedJvmTypeAccess != null && indexedJvmTypeAccess.isIndexingPhase(getResourceSet())) {
return false;
}
}
return true;
}
use of org.eclipse.xtext.common.types.access.impl.IndexedJvmTypeAccess in project xtext-eclipse by eclipse.
the class JdtTypeProvider method findObjectTypeInIndex.
private JvmType findObjectTypeInIndex(/* @NonNull */
String signature, /* @NonNull */
URI resourceURI) throws UnknownNestedTypeException {
IndexedJvmTypeAccess indexedJvmTypeAccess = getIndexedJvmTypeAccess();
if (indexedJvmTypeAccess != null) {
URI proxyURI = resourceURI.appendFragment(typeUriHelper.getFragment(signature));
EObject candidate = indexedJvmTypeAccess.getIndexedJvmType(proxyURI, getResourceSet(), true);
if (candidate instanceof JvmType) {
return (JvmType) candidate;
}
}
return null;
}
Aggregations