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


Java IResourceDescription.Manager方法代码示例

本文整理汇总了Java中org.eclipse.xtext.resource.IResourceDescription.Manager方法的典型用法代码示例。如果您正苦于以下问题:Java IResourceDescription.Manager方法的具体用法?Java IResourceDescription.Manager怎么用?Java IResourceDescription.Manager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.xtext.resource.IResourceDescription的用法示例。


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

示例1: indexResource

import org.eclipse.xtext.resource.IResourceDescription; //导入方法依赖的package包/类
/**
 * Install the given resource's description into the given index. Raw JavaScript files will not be indexed. Note
 * that when this method is called for the given resource, it is not yet fully processed and therefore the
 * serialized type model is not added to the index.
 * <p>
 * This is due to the fact that we keep a common resource set for all projects that contains the resources of all
 * projects with unprocessed dependencies, unlike in the IDE case where we have one resource set per open document
 * and load the type models from the index.
 * </p>
 * <p>
 * Since the type models are available in the resource set as long as they may still be referenced, they need not be
 * serialized and stored into the index.
 * </p>
 *
 * @param resource
 *            the resource to be indexed
 * @param index
 *            the index to add the given resource to
 */
private void indexResource(Resource resource, ResourceDescriptionsData index) {
	if (!shouldIndexResource(resource))
		return;

	final URI uri = resource.getURI();
	IResourceServiceProvider serviceProvider = IResourceServiceProvider.Registry.INSTANCE
			.getResourceServiceProvider(uri);
	if (serviceProvider != null) {
		if (logger.isCreateDebugOutput()) {
			logger.debug("  Indexing resource " + uri);
		}

		IResourceDescription.Manager resourceDescriptionManager = serviceProvider.getResourceDescriptionManager();
		IResourceDescription resourceDescription = resourceDescriptionManager.getResourceDescription(resource);

		if (resourceDescription != null) {
			index.addDescription(uri, resourceDescription);
		}
	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:40,代码来源:N4HeadlessCompiler.java

示例2: computeResourceDescription

import org.eclipse.xtext.resource.IResourceDescription; //导入方法依赖的package包/类
private IResourceDescription computeResourceDescription(URI uri) {
	Resource resource = resourceSet.getResource(uri, false);
	if (resource == null)
		return null;
	IResourceServiceProvider resourceServiceProvider = registry.getResourceServiceProvider(uri);
	if (resourceServiceProvider == null)
		return null;
	IResourceDescription.Manager manager = resourceServiceProvider.getResourceDescriptionManager();
	if (manager == null)
		return null;
	return manager.getResourceDescription(resource);
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:13,代码来源:EagerResourceSetBasedResourceDescriptions.java

示例3: doCheckUniqueNames

import org.eclipse.xtext.resource.IResourceDescription; //导入方法依赖的package包/类
public void doCheckUniqueNames(Resource resource, CancelIndicator cancelIndicator) {
	final IResourceServiceProvider resourceServiceProvider = resourceServiceProviderRegistry.getResourceServiceProvider(resource.getURI());
	if (resourceServiceProvider==null)
		return;
	IResourceDescription.Manager manager = resourceServiceProvider.getResourceDescriptionManager();
	if (manager != null) {
		IResourceDescription description = manager.getResourceDescription(resource);
		if (description != null) {
			Iterable<IEObjectDescription> descriptions = description.getExportedObjects();
			helper.checkUniqueNames(descriptions, cancelIndicator, this);
		}
	}
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:14,代码来源:NamesAreUniqueValidator.java

示例4: getResourceDescription

import org.eclipse.xtext.resource.IResourceDescription; //导入方法依赖的package包/类
public IResourceDescription getResourceDescription(Resource resource) {
	IResourceServiceProvider resourceServiceProvider = resourceServiceProviderRegistry.getResourceServiceProvider(resource.getURI());
	if (resourceServiceProvider == null)
		return null;
	IResourceDescription.Manager manager = resourceServiceProvider.getResourceDescriptionManager();
	if (manager == null)
		return null;
	IResourceDescription description = manager.getResourceDescription(resource);
	return description;
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:11,代码来源:GlobalResourceDescriptionProvider.java

示例5: addToIndex

import org.eclipse.xtext.resource.IResourceDescription; //导入方法依赖的package包/类
protected IResourceDescription.Delta addToIndex(final Resource resource, final boolean isPreIndexing, final ResourceDescriptionsData oldIndex, final BuildContext context) {
  this._operationCanceledManager.checkCanceled(context.getCancelIndicator());
  final URI uri = resource.getURI();
  final IResourceServiceProvider serviceProvider = context.getResourceServiceProvider(uri);
  final IResourceDescription.Manager manager = serviceProvider.getResourceDescriptionManager();
  final IResourceDescription newDescription = manager.getResourceDescription(resource);
  final IResourceDescription toBeAdded = new Indexer.ResolvedResourceDescription(newDescription);
  IResourceDescription _resourceDescription = null;
  if (oldIndex!=null) {
    _resourceDescription=oldIndex.getResourceDescription(uri);
  }
  final IResourceDescription.Delta delta = manager.createDelta(_resourceDescription, toBeAdded);
  return delta;
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:15,代码来源:Indexer.java

示例6: isAffected

import org.eclipse.xtext.resource.IResourceDescription; //导入方法依赖的package包/类
protected boolean isAffected(final IResourceDescription affectionCandidate, final IResourceDescription.Manager manager, final Collection<IResourceDescription.Delta> newDeltas, final Collection<IResourceDescription.Delta> allDeltas, final IResourceDescriptions resourceDescriptions) {
  if ((manager instanceof IResourceDescription.Manager.AllChangeAware)) {
    return ((IResourceDescription.Manager.AllChangeAware)manager).isAffectedByAny(allDeltas, affectionCandidate, resourceDescriptions);
  } else {
    boolean _isEmpty = newDeltas.isEmpty();
    if (_isEmpty) {
      return false;
    } else {
      return manager.isAffected(newDeltas, affectionCandidate, resourceDescriptions);
    }
  }
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:13,代码来源:Indexer.java

示例7:

import org.eclipse.xtext.resource.IResourceDescription; //导入方法依赖的package包/类
/**
 * Binds resource description manager.
 * 
 * @return {@link TestLanguageResourceDescriptionManager}
 */
// CHECKSTYLE:OFF
@SuppressWarnings("PMD.AvoidDollarSigns")
public Class<? extends IResourceDescription.Manager> bindIResourceDescription$Manager() {
  // CHECKSTYLE:ON
  return TestLanguageResourceDescriptionManager.class;
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:12,代码来源:TestLanguageRuntimeModule.java

示例8: addDeletedURIsToDeltas

import org.eclipse.xtext.resource.IResourceDescription; //导入方法依赖的package包/类
/**
 * Add deltas for the removed resources.
 *
 * @param deletedUris
 *          URIs of the removed resources
 * @param deltas
 *          Deltas
 * @param savedDescriptions
 *          previously saved old resource descriptions
 */
protected void addDeletedURIsToDeltas(final Set<URI> deletedUris, final Set<Delta> deltas, final Map<URI, IResourceDescription> savedDescriptions) {
  for (final URI uri : deletedUris) {
    final IResourceDescription oldDescription = getSavedResourceDescription(savedDescriptions, uri);
    if (oldDescription != null) {
      final IResourceDescription.Manager manager = getResourceDescriptionManager(uri);
      if (manager != null) {
        deltas.add(manager.createDelta(oldDescription, null));
      }
    }
  }
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:22,代码来源:MonitoredClusteringBuilderState.java

示例9: getVisibleContainers

import org.eclipse.xtext.resource.IResourceDescription; //导入方法依赖的package包/类
/**
 * Return the visible containers given a context object.
 *
 * @param context
 *          The context object
 * @param originalResource
 *          the original resource
 * @return The list of visible containers.
 */
protected List<IContainer> getVisibleContainers(final EObject context, final Resource originalResource) { // NOPMD by WTH on 26.01.11 09:26 (NPath
                                                                                                          // complexity...)
  final Resource ctxRsc = originalResource == null ? context.eResource() : originalResource;
  if (!(ctxRsc instanceof XtextResource)) {
    LOGGER.error(MessageFormat.format("Context {0} is not in an Xtext resource: {1}", context, ctxRsc != null ? ctxRsc.getURI() : "null")); //$NON-NLS-1$ //$NON-NLS-2$
    throw new IllegalStateException();
  }
  final XtextResource rsc = (XtextResource) ctxRsc;
  // Cache these container lists, they're expensive to create
  final String key = "CONTAINERCACHE&" + rsc.getURI().toString(); //$NON-NLS-1$
  List<IContainer> result = null;
  final ResourceCache<String, List<IContainer>> cache = CacheManager.getInstance().getOrCreateResourceCache("AbstractPolymorphicScopeProvider#cache", rsc); //$NON-NLS-1$
  if (cache != null) {
    result = cache.get(key);
    if (result != null) {
      return result;
    }
  }

  final EObject ctx = ctxRsc != context.eResource() ? ctxRsc.getContents().get(0) : context;
  // We need to get the container manager dynamically, otherwise we may end up using the wrong ResourceDescriptions if
  // the context object in actually from another resource.
  final IResourceServiceProvider resourceServiceProvider = rsc.getResourceServiceProvider();
  final IResourceDescription.Manager descriptionManager = resourceServiceProvider.getResourceDescriptionManager();
  final IContainer.Manager containerManager = resourceServiceProvider.getContainerManager();

  final IResourceDescription description = descriptionManager.getResourceDescription(ctx.eResource());
  final IResourceDescriptions resourceDescriptions = getResourceDescriptions(ctx.eResource());
  result = containerManager.getVisibleContainers(description, resourceDescriptions);
  if (cache != null) {
    cache.set(key, result);
  }
  return result;
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:44,代码来源:AbstractPolymorphicScopeProvider.java

示例10:

import org.eclipse.xtext.resource.IResourceDescription; //导入方法依赖的package包/类
public Class<? extends IResourceDescription.Manager> bindIResourceDescription$Manager() {
  return DerivedStateAwareResourceDescriptionManager.class;
}
 
开发者ID:occiware,项目名称:OCCI-Studio,代码行数:4,代码来源:OCCIRuntimeModule.java

示例11:

import org.eclipse.xtext.resource.IResourceDescription; //导入方法依赖的package包/类
public Class<? extends IResourceDescription.Manager> bindIResourceDescription$Manager() {
	return DerivedStateAwareResourceDescriptionManager.class;
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:4,代码来源:DefaultXbaseRuntimeModule.java

示例12: getResourceDescriptionManager

import org.eclipse.xtext.resource.IResourceDescription; //导入方法依赖的package包/类
public IResourceDescription.Manager getResourceDescriptionManager() {
	return resourceServiceProvider.getResourceDescriptionManager();
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:4,代码来源:LanguageAccess.java

示例13: getResourceDescriptionManager

import org.eclipse.xtext.resource.IResourceDescription; //导入方法依赖的package包/类
@Override
public IResourceDescription.Manager getResourceDescriptionManager() {
  return this.<IResourceDescription.Manager>get(IResourceDescription.Manager.class);
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:5,代码来源:JavaResourceServiceProvider.java

示例14: getResourceDescriptionManager

import org.eclipse.xtext.resource.IResourceDescription; //导入方法依赖的package包/类
@Override
public IResourceDescription.Manager getResourceDescriptionManager() {
	return resourceDescriptionManager;
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:5,代码来源:GenericResourceServiceProvider.java

示例15:

import org.eclipse.xtext.resource.IResourceDescription; //导入方法依赖的package包/类
public Class<? extends IResourceDescription.Manager> bindIResourceDescription$Manager() {
	return GenericResourceDescriptionManager.class;
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:4,代码来源:AbstractGenericResourceRuntimeModule.java


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