Search in sources :

Example 1 with NullJdtTypeProvider

use of org.eclipse.xtext.common.types.access.jdt.NullJdtTypeProvider in project dsl-devkit by dsldevkit.

the class JdtFallbackTypeProviderFactory method createBundleAwareDelegate.

/**
 * Creates a new bundle aware JdtFallbackTypeProvider.
 * <p>
 * <em>Note</em>: Uses a custom bundle class finder to locate and load classes.
 * </p>
 *
 * @param typeProvider
 *          the {@link IJdtTypeProvider}, may be {@code null}
 * @param resourceSet
 *          the {@link ResourceSet}, must not be {@code null}
 * @return the {@link IJdtTypeProvider}, never {@code null}
 */
protected IJdtTypeProvider createBundleAwareDelegate(final IJdtTypeProvider typeProvider, final ResourceSet resourceSet) {
    IJdtTypeProvider firstProvider = typeProvider instanceof NullJdtTypeProvider ? null : typeProvider;
    BundleAwareTypeProvider bundleAwareTypeProvider = new BundleAwareTypeProvider(classLoader, resourceSet, indexedJvmTypeAccess, typeResourceServices);
    JdtFallbackTypeProvider result = new JdtFallbackTypeProvider(firstProvider, bundleAwareTypeProvider);
    resourceSet.getResourceFactoryRegistry().getProtocolToFactoryMap().put(URIHelperConstants.PROTOCOL, result);
    return result;
}
Also used : NullJdtTypeProvider(org.eclipse.xtext.common.types.access.jdt.NullJdtTypeProvider) BundleAwareTypeProvider(com.avaloq.tools.ddk.xtext.common.types.access.jdt.BundleAwareTypeProvider) IJdtTypeProvider(org.eclipse.xtext.common.types.access.jdt.IJdtTypeProvider)

Aggregations

BundleAwareTypeProvider (com.avaloq.tools.ddk.xtext.common.types.access.jdt.BundleAwareTypeProvider)1 IJdtTypeProvider (org.eclipse.xtext.common.types.access.jdt.IJdtTypeProvider)1 NullJdtTypeProvider (org.eclipse.xtext.common.types.access.jdt.NullJdtTypeProvider)1