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


Java IReferenceFinder类代码示例

本文整理汇总了Java中org.eclipse.xtext.findReferences.IReferenceFinder的典型用法代码示例。如果您正苦于以下问题:Java IReferenceFinder类的具体用法?Java IReferenceFinder怎么用?Java IReferenceFinder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IReferenceFinder类属于org.eclipse.xtext.findReferences包,在下文中一共展示了IReferenceFinder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: findReferencesTo

import org.eclipse.xtext.findReferences.IReferenceFinder; //导入依赖的package包/类
/**
 * Find all references to the given target with its resource set as working environment.
 *
 * @param target
 *            the object to look for.
 * @param monitor
 *            the progress monitor.
 * @return the list of reference descriptions.
 */
public List<IReferenceDescription> findReferencesTo(EObject target, IProgressMonitor monitor) {
	final TargetURIs targetURIs = getTargetURIs(target);
	final ResourceSet resourceSet = target.eResource().getResourceSet();
	final List<IReferenceDescription> result = Lists.newArrayList();
	IReferenceFinder.IResourceAccess resourceAccess = new SimpleResourceAccess(resourceSet);
	IReferenceFinder.Acceptor acceptor = new IReferenceFinder.Acceptor() {

		@Override
		public void accept(IReferenceDescription description) {
			result.add(description);
		}

		@Override
		public void accept(EObject source, URI sourceURI, EReference eReference, int index, EObject targetOrProxy,
				URI targetURI) {
			accept(new DefaultReferenceDescription(sourceURI, targetURI, eReference, index, null));
		}
	};
	referenceFinder.findAllReferences(targetURIs, resourceAccess,
			resourceDescriptionsProvider.getResourceDescriptions(resourceSet),
			acceptor, monitor);
	return result;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:33,代码来源:HeadlessReferenceFinder.java

示例2: getSymbols

import org.eclipse.xtext.findReferences.IReferenceFinder; //导入依赖的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: getDefinitions

import org.eclipse.xtext.findReferences.IReferenceFinder; //导入依赖的package包/类
public List<? extends Location> getDefinitions(final XtextResource resource, final int offset, final IReferenceFinder.IResourceAccess resourceAccess, final CancelIndicator cancelIndicator) {
  final EObject element = this._eObjectAtOffsetHelper.resolveElementAt(resource, offset);
  if ((element == null)) {
    return CollectionLiterals.<Location>emptyList();
  }
  final ArrayList<Location> locations = CollectionLiterals.<Location>newArrayList();
  final TargetURIs targetURIs = this.collectTargetURIs(element);
  for (final URI targetURI : targetURIs) {
    {
      this.operationCanceledManager.checkCanceled(cancelIndicator);
      final Procedure1<EObject> _function = (EObject obj) -> {
        final Location location = this._documentExtensions.newLocation(obj);
        if ((location != null)) {
          locations.add(location);
        }
      };
      this.doRead(resourceAccess, targetURI, _function);
    }
  }
  return locations;
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:22,代码来源:DocumentSymbolService.java

示例4: getReferences

import org.eclipse.xtext.findReferences.IReferenceFinder; //导入依赖的package包/类
public List<? extends Location> getReferences(final XtextResource resource, final int offset, final IReferenceFinder.IResourceAccess resourceAccess, final IResourceDescriptions indexData, final CancelIndicator cancelIndicator) {
  final EObject element = this._eObjectAtOffsetHelper.resolveElementAt(resource, offset);
  if ((element == null)) {
    return CollectionLiterals.<Location>emptyList();
  }
  final ArrayList<Location> locations = CollectionLiterals.<Location>newArrayList();
  final TargetURIs targetURIs = this.collectTargetURIs(element);
  final IAcceptor<IReferenceDescription> _function = (IReferenceDescription reference) -> {
    final Procedure1<EObject> _function_1 = (EObject obj) -> {
      final Location location = this._documentExtensions.newLocation(obj, reference.getEReference(), reference.getIndexInList());
      if ((location != null)) {
        locations.add(location);
      }
    };
    this.doRead(resourceAccess, reference.getSourceEObjectUri(), _function_1);
  };
  ReferenceAcceptor _referenceAcceptor = new ReferenceAcceptor(this.resourceServiceProviderRegistry, _function);
  CancelIndicatorProgressMonitor _cancelIndicatorProgressMonitor = new CancelIndicatorProgressMonitor(cancelIndicator);
  this.referenceFinder.findAllReferences(targetURIs, resourceAccess, indexData, _referenceAcceptor, _cancelIndicatorProgressMonitor);
  return locations;
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:22,代码来源:DocumentSymbolService.java

示例5: getSymbols

import org.eclipse.xtext.findReferences.IReferenceFinder; //导入依赖的package包/类
public List<? extends SymbolInformation> getSymbols(final IResourceDescription resourceDescription, final String query, final IReferenceFinder.IResourceAccess resourceAccess, final CancelIndicator cancelIndicator) {
  final LinkedList<SymbolInformation> symbols = CollectionLiterals.<SymbolInformation>newLinkedList();
  Iterable<IEObjectDescription> _exportedObjects = resourceDescription.getExportedObjects();
  for (final IEObjectDescription description : _exportedObjects) {
    {
      this.operationCanceledManager.checkCanceled(cancelIndicator);
      boolean _filter = this.filter(description, query);
      if (_filter) {
        final Procedure1<SymbolInformation> _function = (SymbolInformation symbol) -> {
          symbols.add(symbol);
        };
        this.createSymbol(description, resourceAccess, _function);
      }
    }
  }
  return symbols;
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:18,代码来源:DocumentSymbolService.java

示例6: getData

import org.eclipse.xtext.findReferences.IReferenceFinder; //导入依赖的package包/类
/**
 * Get or create a data cache in the user data space of the given target URIs.
 *
 * @return a new or existing data cache.
 */
public Data getData(TargetURIs targetURIs, IReferenceFinder.IResourceAccess resourceAccess) {
	Data result = targetURIs.getUserData(KEY);
	if (result != null) {
		return result;
	}
	return initData(targetURIs, resourceAccess);
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:13,代码来源:TargetURIKey.java

示例7: ForwardingResourceAccess

import org.eclipse.xtext.findReferences.IReferenceFinder; //导入依赖的package包/类
/**
 * Configure the delegate.
 *
 * @param delegate
 *            the delegate to use.
 */

public ForwardingResourceAccess(IReferenceFinder.IResourceAccess delegate,
		IResourceSetProvider resourceSetProvider) {
	this.delegate = delegate;
	this.resourceSetProvider = resourceSetProvider;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:13,代码来源:ForwardingResourceAccess.java

示例8: createSymbol

import org.eclipse.xtext.findReferences.IReferenceFinder; //导入依赖的package包/类
protected void createSymbol(final IEObjectDescription description, final IReferenceFinder.IResourceAccess resourceAccess, final Procedure1<? super SymbolInformation> acceptor) {
  final String name = this.getSymbolName(description);
  if ((name == null)) {
    return;
  }
  final SymbolKind kind = this.getSymbolKind(description);
  if ((kind == null)) {
    return;
  }
  final Procedure1<Location> _function = (Location location) -> {
    final SymbolInformation symbol = new SymbolInformation(name, kind, location);
    acceptor.apply(symbol);
  };
  this.getSymbolLocation(description, resourceAccess, _function);
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:16,代码来源:DocumentSymbolService.java

示例9: getSymbolLocation

import org.eclipse.xtext.findReferences.IReferenceFinder; //导入依赖的package包/类
protected void getSymbolLocation(final IEObjectDescription description, final IReferenceFinder.IResourceAccess resourceAccess, final Procedure1<? super Location> acceptor) {
  final Procedure1<EObject> _function = (EObject obj) -> {
    final Location location = this.getSymbolLocation(obj);
    if ((location != null)) {
      acceptor.apply(location);
    }
  };
  this.doRead(resourceAccess, description.getEObjectURI(), _function);
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:10,代码来源:DocumentSymbolService.java

示例10: doRead

import org.eclipse.xtext.findReferences.IReferenceFinder; //导入依赖的package包/类
protected void doRead(final IReferenceFinder.IResourceAccess resourceAccess, final URI objectURI, final Procedure1<? super EObject> acceptor) {
  final IUnitOfWork<Object, ResourceSet> _function = (ResourceSet resourceSet) -> {
    final EObject object = resourceSet.getEObject(objectURI, true);
    if ((object != null)) {
      acceptor.apply(object);
    }
    return null;
  };
  resourceAccess.<Object>readOnly(objectURI, _function);
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:11,代码来源:DocumentSymbolService.java

示例11: initData

import org.eclipse.xtext.findReferences.IReferenceFinder; //导入依赖的package包/类
private Data initData(TargetURIs targetURIs, IReferenceFinder.IResourceAccess resourceAccess) {
	Data result = new Data(qualifiedNameProvider);
	init(result, resourceAccess, targetURIs);
	targetURIs.putUserData(KEY, result);
	return result;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:7,代码来源:TargetURIKey.java

示例12: bindReferenceFinder

import org.eclipse.xtext.findReferences.IReferenceFinder; //导入依赖的package包/类
/***/
public Class<? extends IReferenceFinder> bindReferenceFinder() {
	return ConcreteSyntaxAwareReferenceFinder.class;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:5,代码来源:N4JSUiModule.java

示例13: getResourceAccess

import org.eclipse.xtext.findReferences.IReferenceFinder; //导入依赖的package包/类
@Pure
protected IReferenceFinder.IResourceAccess getResourceAccess() {
  return this.resourceAccess;
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:5,代码来源:AbstractHierarchyBuilder.java

示例14: setResourceAccess

import org.eclipse.xtext.findReferences.IReferenceFinder; //导入依赖的package包/类
public void setResourceAccess(final IReferenceFinder.IResourceAccess resourceAccess) {
  this.resourceAccess = resourceAccess;
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:4,代码来源:AbstractHierarchyBuilder.java

示例15: getReferenceFinder

import org.eclipse.xtext.findReferences.IReferenceFinder; //导入依赖的package包/类
@Pure
protected IReferenceFinder getReferenceFinder() {
  return this.referenceFinder;
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:5,代码来源:AbstractHierarchyBuilder.java


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