Search in sources :

Example 1 with JavaProjectClasspathChangeAnalyzer

use of org.eclipse.xtext.ui.util.JavaProjectClasspathChangeAnalyzer in project xtext-eclipse by eclipse.

the class JavaProjectsStateTest method createProjectsState.

@Override
protected JavaProjectsState createProjectsState(IStorage2UriMapper mapper) {
    JavaProjectsState result = new JavaProjectsState();
    result.setMapper(mapper);
    result.setJdtHelper(new JdtHelper());
    result.setJavaProjectClasspathChangeAnalyzer(new JavaProjectClasspathChangeAnalyzer());
    JavaProjectsStateHelper javaProjectsStateHelper = new JavaProjectsStateHelper();
    javaProjectsStateHelper.setMapper(mapper);
    javaProjectsStateHelper.setUriMapperExtensions((IStorage2UriMapperJdtExtensions) ((Storage2UriMapperImpl) mapper).getContribution());
    javaProjectsStateHelper.setWorkspace(ResourcesPlugin.getWorkspace());
    result.setJavaProjectsHelper(javaProjectsStateHelper);
    WorkspaceProjectsStateHelper workspaceStateHelper = new WorkspaceProjectsStateHelper();
    workspaceStateHelper.setMapper(mapper);
    workspaceStateHelper.setWorkspace(ResourcesPlugin.getWorkspace());
    result.setProjectsHelper(workspaceStateHelper);
    return result;
}
Also used : JavaProjectsState(org.eclipse.xtext.ui.containers.JavaProjectsState) JavaProjectsStateHelper(org.eclipse.xtext.ui.containers.JavaProjectsStateHelper) Storage2UriMapperImpl(org.eclipse.xtext.ui.resource.Storage2UriMapperImpl) WorkspaceProjectsStateHelper(org.eclipse.xtext.ui.containers.WorkspaceProjectsStateHelper) JdtHelper(org.eclipse.xtext.ui.shared.JdtHelper) JavaProjectClasspathChangeAnalyzer(org.eclipse.xtext.ui.util.JavaProjectClasspathChangeAnalyzer)

Example 2 with JavaProjectClasspathChangeAnalyzer

use of org.eclipse.xtext.ui.util.JavaProjectClasspathChangeAnalyzer in project xtext-eclipse by eclipse.

the class Storage2UriMapperJavaImplTest method createFreshStorage2UriMapper.

protected Storage2UriMapperJavaImpl createFreshStorage2UriMapper() {
    Storage2UriMapperJavaImpl mapper = new Storage2UriMapperJavaImpl();
    mapper.setUriValidator(new UriValidator() {

        @Override
        public boolean isPossiblyManaged(IStorage storage) {
            return "indexed".equals(storage.getFullPath().getFileExtension());
        }

        @Override
        public boolean isValid(URI uri, IStorage storage) {
            return "indexed".equals(storage.getFullPath().getFileExtension());
        }
    });
    mapper.setLocator(new JarEntryLocator());
    mapper.setWorkspace(ResourcesPlugin.getWorkspace());
    mapper.setWorkspaceLockAccess(new WorkspaceLockAccess());
    mapper.setJavaProjectClasspathChangeAnalyzer(new JavaProjectClasspathChangeAnalyzer());
    return mapper;
}
Also used : WorkspaceLockAccess(org.eclipse.xtext.ui.workspace.WorkspaceLockAccess) Storage2UriMapperJavaImpl(org.eclipse.xtext.ui.resource.Storage2UriMapperJavaImpl) JarEntryLocator(org.eclipse.xtext.ui.resource.JarEntryLocator) UriValidator(org.eclipse.xtext.ui.resource.UriValidator) IStorage(org.eclipse.core.resources.IStorage) JavaProjectClasspathChangeAnalyzer(org.eclipse.xtext.ui.util.JavaProjectClasspathChangeAnalyzer) URI(org.eclipse.emf.common.util.URI)

Example 3 with JavaProjectClasspathChangeAnalyzer

use of org.eclipse.xtext.ui.util.JavaProjectClasspathChangeAnalyzer in project xtext-eclipse by eclipse.

the class StrictJavaProjectsStateTest method createProjectsState.

@Override
protected StrictJavaProjectsState createProjectsState(IStorage2UriMapper mapper) {
    StrictJavaProjectsState result = new StrictJavaProjectsState();
    result.setMapper(mapper);
    result.setJdtHelper(new JdtHelper());
    result.setJavaProjectClasspathChangeAnalyzer(new JavaProjectClasspathChangeAnalyzer());
    JavaProjectsStateHelper javaProjectsStateHelper = new JavaProjectsStateHelper();
    javaProjectsStateHelper.setMapper(mapper);
    javaProjectsStateHelper.setUriMapperExtensions((IStorage2UriMapperJdtExtensions) ((Storage2UriMapperImpl) mapper).getContribution());
    javaProjectsStateHelper.setWorkspace(ResourcesPlugin.getWorkspace());
    result.setHelper(javaProjectsStateHelper);
    return result;
}
Also used : JavaProjectsStateHelper(org.eclipse.xtext.ui.containers.JavaProjectsStateHelper) Storage2UriMapperImpl(org.eclipse.xtext.ui.resource.Storage2UriMapperImpl) JdtHelper(org.eclipse.xtext.ui.shared.JdtHelper) JavaProjectClasspathChangeAnalyzer(org.eclipse.xtext.ui.util.JavaProjectClasspathChangeAnalyzer) StrictJavaProjectsState(org.eclipse.xtext.ui.containers.StrictJavaProjectsState)

Aggregations

JavaProjectClasspathChangeAnalyzer (org.eclipse.xtext.ui.util.JavaProjectClasspathChangeAnalyzer)3 JavaProjectsStateHelper (org.eclipse.xtext.ui.containers.JavaProjectsStateHelper)2 Storage2UriMapperImpl (org.eclipse.xtext.ui.resource.Storage2UriMapperImpl)2 JdtHelper (org.eclipse.xtext.ui.shared.JdtHelper)2 IStorage (org.eclipse.core.resources.IStorage)1 URI (org.eclipse.emf.common.util.URI)1 JavaProjectsState (org.eclipse.xtext.ui.containers.JavaProjectsState)1 StrictJavaProjectsState (org.eclipse.xtext.ui.containers.StrictJavaProjectsState)1 WorkspaceProjectsStateHelper (org.eclipse.xtext.ui.containers.WorkspaceProjectsStateHelper)1 JarEntryLocator (org.eclipse.xtext.ui.resource.JarEntryLocator)1 Storage2UriMapperJavaImpl (org.eclipse.xtext.ui.resource.Storage2UriMapperJavaImpl)1 UriValidator (org.eclipse.xtext.ui.resource.UriValidator)1 WorkspaceLockAccess (org.eclipse.xtext.ui.workspace.WorkspaceLockAccess)1