use of org.eclipse.xtext.ui.containers.JavaProjectsState 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());
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.JavaProjectsState in project xtext-eclipse by eclipse.
the class DeltaConverter method isDerived.
/**
* @since 2.8
*/
protected boolean isDerived(String typeName, IJavaProject project) {
QualifiedName qualifiedName = nameConverter.toQualifiedName(typeName);
Iterable<IEObjectDescription> iterable = resourceDescriptions.getExportedObjects(TypesPackage.Literals.JVM_TYPE, qualifiedName, false);
Iterator<IEObjectDescription> iterator = iterable.iterator();
if (iterator.hasNext()) {
if (project != null) {
JavaProjectsState javaProjectsState = getJavaProjectsState();
List<String> visibleContainers = javaProjectsState.getVisibleContainerHandles(project.getHandleIdentifier());
while (iterator.hasNext()) {
IEObjectDescription description = iterator.next();
URI resourceURI = description.getEObjectURI().trimFragment();
String handle = javaProjectsState.getContainerHandle(resourceURI);
if (visibleContainers.contains(handle)) {
return true;
}
}
return false;
}
return true;
}
return false;
}
Aggregations