use of org.eclipse.xtext.ui.containers.WorkspaceProjectsStateHelper 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;
}
use of org.eclipse.xtext.ui.containers.WorkspaceProjectsStateHelper in project xtext-eclipse by eclipse.
the class StateBasedContainerManagerTest method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
IResourcesSetupUtil.setReference(project1, project2);
uri1 = createFileAndRegisterResource(project1, "file1");
uri2 = createFileAndRegisterResource(project1, "file2");
uri3 = createFileAndRegisterResource(project2, "file3");
Storage2UriMapperImpl mapper = new Storage2UriMapperImpl() {
@Override
public boolean isValidUri(URI uri, IStorage storage) {
return uri != null && !uri.toString().endsWith("/.project");
}
};
mapper.setUriValidator(new UriValidator() {
@Override
public boolean isPossiblyManaged(IStorage storage) {
return true;
}
@Override
public boolean isValid(URI uri, IStorage storage) {
return true;
}
});
projectsState = new WorkspaceProjectsState();
projectsState.setMapper(mapper);
WorkspaceProjectsStateHelper helper = new WorkspaceProjectsStateHelper();
helper.setMapper(mapper);
helper.setWorkspace(ResourcesPlugin.getWorkspace());
projectsState.setHelper(helper);
containerManager = new StateBasedContainerManager();
containerManager.setStateProvider(this);
containerManager.setDelegate(new ProjectDescriptionBasedContainerManager());
}
use of org.eclipse.xtext.ui.containers.WorkspaceProjectsStateHelper in project xtext-eclipse by eclipse.
the class WorkspaceProjectsStateTest method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
uri1 = createFileAndRegisterResource(project1, "file1");
uri2 = createFileAndRegisterResource(project1, "file2");
uri3 = createFileAndRegisterResource(project2, "file3");
Storage2UriMapperImpl mapper = new Storage2UriMapperImpl() {
@Override
public boolean isValidUri(URI uri, IStorage storage) {
return uri != null && !uri.toString().endsWith("/.project");
}
};
mapper.setUriValidator(new UriValidator() {
@Override
public boolean isValid(URI uri, IStorage storage) {
return true;
}
@Override
public boolean isPossiblyManaged(IStorage storage) {
return true;
}
});
projectsState = new WorkspaceProjectsState();
projectsState.setMapper(mapper);
WorkspaceProjectsStateHelper helper = new WorkspaceProjectsStateHelper();
helper.setMapper(mapper);
helper.setWorkspace(ResourcesPlugin.getWorkspace());
projectsState.setHelper(helper);
}
Aggregations