本文整理汇总了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);
}
}
}
示例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);
}
示例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);
}
}
}
示例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;
}
示例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;
}
示例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);
}
}
}
示例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;
}
示例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));
}
}
}
}
示例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;
}
示例10:
import org.eclipse.xtext.resource.IResourceDescription; //导入方法依赖的package包/类
public Class<? extends IResourceDescription.Manager> bindIResourceDescription$Manager() {
return DerivedStateAwareResourceDescriptionManager.class;
}
示例11:
import org.eclipse.xtext.resource.IResourceDescription; //导入方法依赖的package包/类
public Class<? extends IResourceDescription.Manager> bindIResourceDescription$Manager() {
return DerivedStateAwareResourceDescriptionManager.class;
}
示例12: getResourceDescriptionManager
import org.eclipse.xtext.resource.IResourceDescription; //导入方法依赖的package包/类
public IResourceDescription.Manager getResourceDescriptionManager() {
return resourceServiceProvider.getResourceDescriptionManager();
}
示例13: getResourceDescriptionManager
import org.eclipse.xtext.resource.IResourceDescription; //导入方法依赖的package包/类
@Override
public IResourceDescription.Manager getResourceDescriptionManager() {
return this.<IResourceDescription.Manager>get(IResourceDescription.Manager.class);
}
示例14: getResourceDescriptionManager
import org.eclipse.xtext.resource.IResourceDescription; //导入方法依赖的package包/类
@Override
public IResourceDescription.Manager getResourceDescriptionManager() {
return resourceDescriptionManager;
}
示例15:
import org.eclipse.xtext.resource.IResourceDescription; //导入方法依赖的package包/类
public Class<? extends IResourceDescription.Manager> bindIResourceDescription$Manager() {
return GenericResourceDescriptionManager.class;
}