Search in sources :

Example 6 with JdtTypeProviderFactory

use of org.eclipse.xtext.common.types.access.jdt.JdtTypeProviderFactory in project xtext-eclipse by eclipse.

the class JdtBasedSimpleTypeScopeProviderTest method setUp.

@Before
public void setUp() throws Exception {
    projectProvider = new MockJavaProjectProvider();
    factory = new JdtTypeProviderFactory(projectProvider);
    IQualifiedNameConverter qualifiedNameConverter = new IQualifiedNameConverter.DefaultImpl();
    scopeProvider = new JdtBasedSimpleTypeScopeProvider(factory, qualifiedNameConverter);
    resourceSet = new ResourceSetImpl();
    resource = new ResourceImpl();
    resource.setURI(URI.createURI("http://does/not/exist.file"));
    emptyResource = new ResourceImpl();
    emptyResource.setURI(URI.createURI("http://does/not/exist.file2"));
    resourceSet.getResources().add(emptyResource);
    resourceSet.getResources().add(resource);
    field = TypesFactory.eINSTANCE.createJvmField();
    resource.getContents().add(field);
}
Also used : JdtTypeProviderFactory(org.eclipse.xtext.common.types.access.jdt.JdtTypeProviderFactory) ResourceSetImpl(org.eclipse.emf.ecore.resource.impl.ResourceSetImpl) ResourceImpl(org.eclipse.emf.ecore.resource.impl.ResourceImpl) JdtBasedSimpleTypeScopeProvider(org.eclipse.xtext.common.types.xtext.ui.JdtBasedSimpleTypeScopeProvider) IQualifiedNameConverter(org.eclipse.xtext.naming.IQualifiedNameConverter) MockJavaProjectProvider(org.eclipse.xtext.common.types.access.jdt.MockJavaProjectProvider) Before(org.junit.Before)

Example 7 with JdtTypeProviderFactory

use of org.eclipse.xtext.common.types.access.jdt.JdtTypeProviderFactory in project xtext-eclipse by eclipse.

the class JdtBasedConstructorScopeTest method setUp.

@Before
public void setUp() throws Exception {
    projectProvider = new MockJavaProjectProvider();
    factory = new JdtTypeProviderFactory(projectProvider);
    resourceSet = new ResourceSetImpl();
    typeScope = new JdtBasedSimpleTypeScope(factory.createTypeProvider(resourceSet), new IQualifiedNameConverter.DefaultImpl(), Predicates.<IEObjectDescription>alwaysTrue());
    constructorScope = new JdtBasedConstructorScope(typeScope);
}
Also used : JdtTypeProviderFactory(org.eclipse.xtext.common.types.access.jdt.JdtTypeProviderFactory) ResourceSetImpl(org.eclipse.emf.ecore.resource.impl.ResourceSetImpl) JdtBasedSimpleTypeScope(org.eclipse.xtext.common.types.xtext.ui.JdtBasedSimpleTypeScope) JdtBasedConstructorScope(org.eclipse.xtext.common.types.xtext.ui.JdtBasedConstructorScope) MockJavaProjectProvider(org.eclipse.xtext.common.types.access.jdt.MockJavaProjectProvider) IEObjectDescription(org.eclipse.xtext.resource.IEObjectDescription) Before(org.junit.Before)

Example 8 with JdtTypeProviderFactory

use of org.eclipse.xtext.common.types.access.jdt.JdtTypeProviderFactory in project xtext-eclipse by eclipse.

the class JdtBasedSimpleTypeScopeTest method setUp.

@Before
public void setUp() throws Exception {
    projectProvider = new MockJavaProjectProvider();
    factory = new JdtTypeProviderFactory(projectProvider);
    resourceSet = new ResourceSetImpl();
    typeScope = new JdtBasedSimpleTypeScope(factory.createTypeProvider(resourceSet), new IQualifiedNameConverter.DefaultImpl(), Predicates.<IEObjectDescription>alwaysTrue());
}
Also used : JdtTypeProviderFactory(org.eclipse.xtext.common.types.access.jdt.JdtTypeProviderFactory) ResourceSetImpl(org.eclipse.emf.ecore.resource.impl.ResourceSetImpl) JdtBasedSimpleTypeScope(org.eclipse.xtext.common.types.xtext.ui.JdtBasedSimpleTypeScope) MockJavaProjectProvider(org.eclipse.xtext.common.types.access.jdt.MockJavaProjectProvider) IEObjectDescription(org.eclipse.xtext.resource.IEObjectDescription) Before(org.junit.Before)

Example 9 with JdtTypeProviderFactory

use of org.eclipse.xtext.common.types.access.jdt.JdtTypeProviderFactory in project xtext-eclipse by eclipse.

the class AbstractContentAssistTest method initializeTypeProvider.

protected void initializeTypeProvider(XtextResourceSet resourceSet) {
    JdtTypeProviderFactory typeProviderFactory = new JdtTypeProviderFactory(this);
    typeProviderFactory.findOrCreateTypeProvider(resourceSet);
    resourceSet.setClasspathURIContext(getJavaProject(resourceSet));
}
Also used : JdtTypeProviderFactory(org.eclipse.xtext.common.types.access.jdt.JdtTypeProviderFactory)

Example 10 with JdtTypeProviderFactory

use of org.eclipse.xtext.common.types.access.jdt.JdtTypeProviderFactory in project xtext-eclipse by eclipse.

the class AbstractContentAssistTest method initializeTypeProvider.

protected void initializeTypeProvider(final XtextResourceSet set) {
    final JdtTypeProviderFactory typeProviderFactory = new JdtTypeProviderFactory(this);
    typeProviderFactory.findOrCreateTypeProvider(set);
    set.setClasspathURIContext(getJavaProject(set));
}
Also used : JdtTypeProviderFactory(org.eclipse.xtext.common.types.access.jdt.JdtTypeProviderFactory)

Aggregations

JdtTypeProviderFactory (org.eclipse.xtext.common.types.access.jdt.JdtTypeProviderFactory)11 XtextResourceSet (org.eclipse.xtext.resource.XtextResourceSet)5 IJvmTypeProvider (org.eclipse.xtext.common.types.access.IJvmTypeProvider)4 ResourceSetImpl (org.eclipse.emf.ecore.resource.impl.ResourceSetImpl)3 MockJavaProjectProvider (org.eclipse.xtext.common.types.access.jdt.MockJavaProjectProvider)3 Before (org.junit.Before)3 JdtBasedSimpleTypeScope (org.eclipse.xtext.common.types.xtext.ui.JdtBasedSimpleTypeScope)2 IEObjectDescription (org.eclipse.xtext.resource.IEObjectDescription)2 ResourceImpl (org.eclipse.emf.ecore.resource.impl.ResourceImpl)1 JdtBasedConstructorScope (org.eclipse.xtext.common.types.xtext.ui.JdtBasedConstructorScope)1 JdtBasedSimpleTypeScopeProvider (org.eclipse.xtext.common.types.xtext.ui.JdtBasedSimpleTypeScopeProvider)1 IQualifiedNameConverter (org.eclipse.xtext.naming.IQualifiedNameConverter)1