当前位置: 首页>>代码示例>>Java>>正文


Java IResourceDescriptions.getAllResourceDescriptions方法代码示例

本文整理汇总了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);
			}
		}
	}
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:21,代码来源:ReferenceFinder.java

示例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;
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:21,代码来源:WorkspaceSymbolService.java

示例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());
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:16,代码来源:AbstractBuilderTest.java

示例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();
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:9,代码来源:BuilderUtil.java

示例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;
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:14,代码来源:SlotEntry.java

示例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;
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:15,代码来源:ResourceDescriptionsUtil.java


注:本文中的org.eclipse.xtext.resource.IResourceDescriptions.getAllResourceDescriptions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。