本文整理汇总了Java中org.eclipse.xtext.resource.IResourceDescriptions.getAllResourceDescriptions方法的典型用法代码示例。如果您正苦于以下问题:Java IResourceDescriptions.getAllResourceDescriptions方法的具体用法?Java IResourceDescriptions.getAllResourceDescriptions怎么用?Java IResourceDescriptions.getAllResourceDescriptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.xtext.resource.IResourceDescriptions
的用法示例。
在下文中一共展示了IResourceDescriptions.getAllResourceDescriptions方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findAllReferences
import org.eclipse.xtext.resource.IResourceDescriptions; //导入方法依赖的package包/类
@Override
public void findAllReferences(TargetURIs targetURIs, IResourceAccess resourceAccess,
IResourceDescriptions indexData, Acceptor acceptor, IProgressMonitor monitor) {
if (!targetURIs.isEmpty()) {
Iterable<IResourceDescription> allResourceDescriptions = indexData.getAllResourceDescriptions();
SubMonitor subMonitor = SubMonitor.convert(monitor, size(allResourceDescriptions) / MONITOR_CHUNK_SIZE + 1);
IProgressMonitor useMe = subMonitor.newChild(1);
int i = 0;
for (IResourceDescription resourceDescription : allResourceDescriptions) {
if (subMonitor.isCanceled())
throw new OperationCanceledException();
IReferenceFinder languageSpecific = getLanguageSpecificReferenceFinder(resourceDescription.getURI());
languageSpecific.findReferences(targetURIs, resourceDescription, resourceAccess, acceptor, useMe);
i++;
if (i % MONITOR_CHUNK_SIZE == 0) {
useMe = subMonitor.newChild(1);
}
}
}
}
示例2: getSymbols
import org.eclipse.xtext.resource.IResourceDescriptions; //导入方法依赖的package包/类
public List<? extends SymbolInformation> getSymbols(final String query, final IReferenceFinder.IResourceAccess resourceAccess, final IResourceDescriptions indexData, final CancelIndicator cancelIndicator) {
final LinkedList<SymbolInformation> result = CollectionLiterals.<SymbolInformation>newLinkedList();
Iterable<IResourceDescription> _allResourceDescriptions = indexData.getAllResourceDescriptions();
for (final IResourceDescription resourceDescription : _allResourceDescriptions) {
{
this.operationCanceledManager.checkCanceled(cancelIndicator);
final IResourceServiceProvider resourceServiceProvider = this._registry.getResourceServiceProvider(resourceDescription.getURI());
DocumentSymbolService _get = null;
if (resourceServiceProvider!=null) {
_get=resourceServiceProvider.<DocumentSymbolService>get(DocumentSymbolService.class);
}
final DocumentSymbolService documentSymbolService = _get;
if ((documentSymbolService != null)) {
List<? extends SymbolInformation> _symbols = documentSymbolService.getSymbols(resourceDescription, query, resourceAccess, cancelIndicator);
Iterables.<SymbolInformation>addAll(result, _symbols);
}
}
}
return result;
}
示例3: assertXtextIndexIsValidInternal
import org.eclipse.xtext.resource.IResourceDescriptions; //导入方法依赖的package包/类
private void assertXtextIndexIsValidInternal() {
final IResourceDescriptions index = getXtextIndex();
final StringBuilder sb = new StringBuilder();
for (IResourceDescription desc : index.getAllResourceDescriptions()) {
if (desc instanceof ResourceDescriptionWithoutModuleUserData) {
sb.append("\n");
sb.append(IResourceDescription.class.getSimpleName());
sb.append(" in index must not be an instance of ");
sb.append(ResourceDescriptionWithoutModuleUserData.class.getSimpleName());
sb.append(" but it was. URI: ");
sb.append(desc.getURI());
}
}
assertTrue(sb.toString(), 0 == sb.length());
}
示例4: toString
import org.eclipse.xtext.resource.IResourceDescriptions; //导入方法依赖的package包/类
/***/
public static String toString(IResourceDescriptions index) {
StringBuffer buff = new StringBuffer();
for (IResourceDescription desc : index.getAllResourceDescriptions()) {
buff.append(EmfFormatter.objToStr(desc, new EStructuralFeature[0]));
}
return buff.toString();
}
示例5: findEObjectsOfType
import org.eclipse.xtext.resource.IResourceDescriptions; //导入方法依赖的package包/类
protected List<EObject> findEObjectsOfType(Set<EClass> eClasses, IResourceDescriptions resourceDescriptions,
ResourceSet resourceSet) {
List<EObject> elements = Lists.newArrayList();
Iterable<IResourceDescription> descriptions = resourceDescriptions.getAllResourceDescriptions();
for (IResourceDescription resDesc : descriptions) {
Iterable<IEObjectDescription> objects = resDesc.getExportedObjects();
for (IEObjectDescription description : objects) {
if (matches(eClasses, description))
elements.add(resourceSet.getEObject(description.getEObjectURI(), true));
}
}
return elements;
}
示例6: getAllURIs
import org.eclipse.xtext.resource.IResourceDescriptions; //导入方法依赖的package包/类
/**
* Returns all URIs in the given resource descriptions object.
*
* @param descriptions
* {@link IResourceDescriptions} to get the URIs for
* @return set of all URIs
*/
public static Set<URI> getAllURIs(final IResourceDescriptions descriptions) {
Set<URI> allURIs = Sets.newHashSetWithExpectedSize(Iterables.size(descriptions.getAllResourceDescriptions()));
for (IResourceDescription desc : descriptions.getAllResourceDescriptions()) {
allURIs.add(desc.getURI());
}
return allURIs;
}