• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java IResourceServiceProvider类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: indexResource

import org.eclipse.xtext.resource.IResourceServiceProvider; //导入依赖的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: newValidationJob

import org.eclipse.xtext.resource.IResourceServiceProvider; //导入依赖的package包/类
private ValidationJob newValidationJob(final XtextEditor editor) {

		final IXtextDocument document = editor.getDocument();
		final IAnnotationModel annotationModel = editor.getInternalSourceViewer().getAnnotationModel();

		final IssueResolutionProvider issueResolutionProvider = getService(editor, IssueResolutionProvider.class);
		final MarkerTypeProvider markerTypeProvider = getService(editor, MarkerTypeProvider.class);
		final MarkerCreator markerCreator = getService(editor, MarkerCreator.class);

		final IValidationIssueProcessor issueProcessor = new CompositeValidationIssueProcessor(
				new AnnotationIssueProcessor(document, annotationModel, issueResolutionProvider),
				new MarkerIssueProcessor(editor.getResource(), markerCreator, markerTypeProvider));

		return editor.getDocument().modify(resource -> {
			final IResourceServiceProvider serviceProvider = resource.getResourceServiceProvider();
			final IResourceValidator resourceValidator = serviceProvider.getResourceValidator();
			return new ValidationJob(resourceValidator, editor.getDocument(), issueProcessor, ALL);
		});
	}
 
开发者ID:eclipse,项目名称:n4js,代码行数:20,代码来源:OwnResourceValidatorAwareValidatingEditorCallback.java


示例3: getText

import org.eclipse.xtext.resource.IResourceServiceProvider; //导入依赖的package包/类
/**
 * Returns a string representation for the find references UI to represent the matches and the queried object.
 * Dispatches to the correct, language specific implementation.
 */
public String getText(EObject source) {
	URI uri = source.eResource().getURI();
	if (!resourceServiceProvider.canHandle(uri)) {
		IResourceServiceProvider otherServiceProvider = resourceServiceProviderRegistry
				.getResourceServiceProvider(uri);
		if (otherServiceProvider != null) {
			ReferenceFinderLabelProvider otherLabelProvider = otherServiceProvider
					.get(ReferenceFinderLabelProvider.class);
			if (otherLabelProvider != null) {
				return otherLabelProvider.doGetText(source);
			}
		}
	}
	return doGetText(source);
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:20,代码来源:ReferenceFinderLabelProvider.java


示例4: codeLens

import org.eclipse.xtext.resource.IResourceServiceProvider; //导入依赖的package包/类
@Override
public CompletableFuture<List<? extends CodeLens>> codeLens(final CodeLensParams params) {
  final Function1<CancelIndicator, List<? extends CodeLens>> _function = (CancelIndicator cancelIndicator) -> {
    final URI uri = this._uriExtensions.toUri(params.getTextDocument().getUri());
    final IResourceServiceProvider resourceServiceProvider = this.languagesRegistry.getResourceServiceProvider(uri);
    ICodeLensService _get = null;
    if (resourceServiceProvider!=null) {
      _get=resourceServiceProvider.<ICodeLensService>get(ICodeLensService.class);
    }
    final ICodeLensService codeLensService = _get;
    if ((codeLensService == null)) {
      return CollectionLiterals.<CodeLens>emptyList();
    }
    final Function2<Document, XtextResource, List<? extends CodeLens>> _function_1 = (Document document, XtextResource resource) -> {
      final List<? extends CodeLens> result = codeLensService.computeCodeLenses(document, resource, params, cancelIndicator);
      this.installURI(result, uri.toString());
      return result;
    };
    return this.workspaceManager.<List<? extends CodeLens>>doRead(uri, _function_1);
  };
  return this.requestManager.<List<? extends CodeLens>>runRead(_function);
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:23,代码来源:LanguageServerImpl.java


示例5: references

import org.eclipse.xtext.resource.IResourceServiceProvider; //导入依赖的package包/类
@Override
public CompletableFuture<List<? extends Location>> references(final ReferenceParams params) {
  final Function1<CancelIndicator, List<? extends Location>> _function = (CancelIndicator cancelIndicator) -> {
    final URI uri = this._uriExtensions.toUri(params.getTextDocument().getUri());
    final IResourceServiceProvider resourceServiceProvider = this.languagesRegistry.getResourceServiceProvider(uri);
    DocumentSymbolService _get = null;
    if (resourceServiceProvider!=null) {
      _get=resourceServiceProvider.<DocumentSymbolService>get(DocumentSymbolService.class);
    }
    final DocumentSymbolService documentSymbolService = _get;
    if ((documentSymbolService == null)) {
      return CollectionLiterals.<Location>emptyList();
    }
    final Function2<Document, XtextResource, List<? extends Location>> _function_1 = (Document document, XtextResource resource) -> {
      return documentSymbolService.getReferences(document, resource, params, this.resourceAccess, this.workspaceManager.getIndex(), cancelIndicator);
    };
    return this.workspaceManager.<List<? extends Location>>doRead(uri, _function_1);
  };
  return this.requestManager.<List<? extends Location>>runRead(_function);
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:21,代码来源:LanguageServerImpl.java


示例6: configure

import org.eclipse.xtext.resource.IResourceServiceProvider; //导入依赖的package包/类
@Override
protected void configure() {
  this.<Resource.Factory>bind(Resource.Factory.class).to(JavaResource.Factory.class);
  this.<IResourceValidator>bind(IResourceValidator.class).toInstance(IResourceValidator.NULL);
  this.<IGenerator>bind(IGenerator.class).to(IGenerator.NullGenerator.class);
  this.<IEncodingProvider>bind(IEncodingProvider.class).to(IEncodingProvider.Runtime.class);
  this.<IResourceServiceProvider>bind(IResourceServiceProvider.class).to(JavaResourceServiceProvider.class);
  this.<IContainer.Manager>bind(IContainer.Manager.class).to(SimpleResourceDescriptionsBasedContainerManager.class);
  this.<IResourceDescription.Manager>bind(IResourceDescription.Manager.class).to(JavaResourceDescriptionManager.class);
  this.<IQualifiedNameProvider>bind(IQualifiedNameProvider.class).to(JvmIdentifiableQualifiedNameProvider.class);
  this.<String>bind(String.class).annotatedWith(Names.named(Constants.FILE_EXTENSIONS)).toInstance("java");
  this.<String>bind(String.class).annotatedWith(Names.named(Constants.LANGUAGE_NAME)).toInstance("org.eclipse.xtext.java.Java");
  this.<IJvmTypeProvider.Factory>bind(IJvmTypeProvider.Factory.class).to(ClasspathTypeProviderFactory.class);
  this.<ClassLoader>bind(ClassLoader.class).toInstance(JavaSourceLanguageRuntimeModule.class.getClassLoader());
  this.<IReferableElementsUnloader>bind(IReferableElementsUnloader.class).to(IReferableElementsUnloader.GenericUnloader.class);
  final IResourceDescriptionsProvider _function = (ResourceSet it) -> {
    return ChunkedResourceDescriptions.findInEmfObject(it);
  };
  this.<IResourceDescriptionsProvider>bind(IResourceDescriptionsProvider.class).toInstance(_function);
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:21,代码来源:JavaSourceLanguageRuntimeModule.java


示例7: signatureHelp

import org.eclipse.xtext.resource.IResourceServiceProvider; //导入依赖的package包/类
@Override
public CompletableFuture<SignatureHelp> signatureHelp(final TextDocumentPositionParams params) {
  final Function1<CancelIndicator, SignatureHelp> _function = (CancelIndicator cancelIndicator) -> {
    final URI uri = this._uriExtensions.toUri(params.getTextDocument().getUri());
    final IResourceServiceProvider serviceProvider = this.languagesRegistry.getResourceServiceProvider(uri);
    ISignatureHelpService _get = null;
    if (serviceProvider!=null) {
      _get=serviceProvider.<ISignatureHelpService>get(ISignatureHelpService.class);
    }
    final ISignatureHelpService helper = _get;
    if ((helper == null)) {
      return ISignatureHelpService.EMPTY;
    }
    final Function2<Document, XtextResource, SignatureHelp> _function_1 = (Document doc, XtextResource resource) -> {
      return helper.getSignatureHelp(doc, resource, params, cancelIndicator);
    };
    return this.workspaceManager.<SignatureHelp>doRead(uri, _function_1);
  };
  return this.requestManager.<SignatureHelp>runRead(_function);
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:21,代码来源:LanguageServerImpl.java


示例8: get

import org.eclipse.xtext.resource.IResourceServiceProvider; //导入依赖的package包/类
@Override
public IResourceServiceProvider get(URI uri, String contentType) {
	Object extension = getExtension();
	if (extension instanceof IResourceServiceProvider.Provider) {
		IResourceServiceProvider.Provider provider = ((IResourceServiceProvider.Provider) extension);
		IResourceServiceProvider result = provider.get(uri, contentType);
		return result;
	} else if (extension instanceof IResourceServiceProvider) {
		return (IResourceServiceProvider) extension;
	}
	String type = extension == null ? "null" : extension.getClass().getName();
	String valid = IResourceServiceProvider.class + " or " + IResourceServiceProvider.Provider.class;
	String suffix = "";
	String contributor = getContributor();
	if (contributor != null) {
		suffix += " contributed by " + contributor;
	}
	throw new ClassCastException("The type " + type + " is not a valid " + valid + suffix);
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:20,代码来源:AbstractResourceServiceProviderDescriptor.java


示例9: getResourceDescription

import org.eclipse.xtext.resource.IResourceServiceProvider; //导入依赖的package包/类
@Override
public IResourceDescription getResourceDescription(URI uri) {
	IResourceDescription result = delegate.getResourceDescription(uri);
	if (result == null) {
		Resource resource = EcoreUtil2.getResource(context, uri.toString());
		if (resource != null) {
			IResourceServiceProvider serviceProvider = serviceProviderRegistry.getResourceServiceProvider(uri);
			if (serviceProvider==null)
				throw new IllegalStateException("No "+IResourceServiceProvider.class.getSimpleName()+" found in registry for uri "+uri);
			final Manager resourceDescriptionManager = serviceProvider.getResourceDescriptionManager();
			if (resourceDescriptionManager == null)
				throw new IllegalStateException("No "+IResourceDescription.Manager.class.getName()+" provided by service provider for URI "+uri);
			result = resourceDescriptionManager.getResourceDescription(resource);
		}
	}
	return result;
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:18,代码来源:LoadOnDemandResourceDescriptions.java


示例10: getSymbols

import org.eclipse.xtext.resource.IResourceServiceProvider; //导入依赖的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


示例11: computeExportedObjectsMap

import org.eclipse.xtext.resource.IResourceServiceProvider; //导入依赖的package包/类
protected void computeExportedObjectsMap(final EObject source) {
  final Resource resource = source.eResource();
  final IResourceServiceProvider resourceServiceProvider = this.resourceServiceProviderRegistry.getResourceServiceProvider(resource.getURI());
  if ((resourceServiceProvider != null)) {
    final IResourceDescription resourceDescription = resourceServiceProvider.getResourceDescriptionManager().getResourceDescription(resource);
    this.exportedContainersInCurrentResource = CollectionLiterals.<EObject, URI>newHashMap();
    Iterable<IEObjectDescription> _exportedObjects = resourceDescription.getExportedObjects();
    for (final IEObjectDescription description : _exportedObjects) {
      {
        EObject instance = description.getEObjectOrProxy();
        boolean _eIsProxy = instance.eIsProxy();
        if (_eIsProxy) {
          instance = resource.getEObject(description.getEObjectURI().fragment());
        }
        this.exportedContainersInCurrentResource.put(instance, description.getEObjectURI());
      }
    }
  } else {
    this.exportedContainersInCurrentResource = CollectionLiterals.<EObject, URI>emptyMap();
  }
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:22,代码来源:ReferenceAcceptor.java


示例12: rename

import org.eclipse.xtext.resource.IResourceServiceProvider; //导入依赖的package包/类
@Override
public CompletableFuture<WorkspaceEdit> rename(final RenameParams params) {
  final Function1<CancelIndicator, WorkspaceEdit> _function = (CancelIndicator cancelIndicator) -> {
    WorkspaceEdit _xblockexpression = null;
    {
      final URI uri = this._uriExtensions.toUri(params.getTextDocument().getUri());
      final IResourceServiceProvider resourceServiceProvider = this.languagesRegistry.getResourceServiceProvider(uri);
      IRenameService _get = null;
      if (resourceServiceProvider!=null) {
        _get=resourceServiceProvider.<IRenameService>get(IRenameService.class);
      }
      final IRenameService renameService = _get;
      if ((renameService == null)) {
        return new WorkspaceEdit();
      }
      _xblockexpression = renameService.rename(this.workspaceManager, params, cancelIndicator);
    }
    return _xblockexpression;
  };
  return this.requestManager.<WorkspaceEdit>runRead(_function);
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:22,代码来源:LanguageServerImpl.java


示例13: codeAction

import org.eclipse.xtext.resource.IResourceServiceProvider; //导入依赖的package包/类
@Override
public CompletableFuture<List<? extends Command>> codeAction(final CodeActionParams params) {
  final Function1<CancelIndicator, List<? extends Command>> _function = (CancelIndicator cancelIndicator) -> {
    final URI uri = this._uriExtensions.toUri(params.getTextDocument().getUri());
    final IResourceServiceProvider serviceProvider = this.languagesRegistry.getResourceServiceProvider(uri);
    ICodeActionService _get = null;
    if (serviceProvider!=null) {
      _get=serviceProvider.<ICodeActionService>get(ICodeActionService.class);
    }
    final ICodeActionService service = _get;
    if ((service == null)) {
      return CollectionLiterals.<Command>emptyList();
    }
    final Function2<Document, XtextResource, List<? extends Command>> _function_1 = (Document doc, XtextResource resource) -> {
      return service.getCodeActions(doc, resource, params, cancelIndicator);
    };
    return this.workspaceManager.<List<? extends Command>>doRead(uri, _function_1);
  };
  return this.requestManager.<List<? extends Command>>runRead(_function);
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:21,代码来源:LanguageServerImpl.java


示例14: getResourceServiceProviderById

import org.eclipse.xtext.resource.IResourceServiceProvider; //导入依赖的package包/类
/**
 * Finds the {@link IResourceServiceProvider} for a language by given its id.
 *
 * @param languageId
 *          the language id (grammar name)
 * @return the {@link IResourceServiceProvider} for the given language id
 */
public IResourceServiceProvider getResourceServiceProviderById(final String languageId) {
  ImmutableMap<Map<String, Object>, ? extends Function<String, IResourceServiceProvider>> resourceProvidersMap = getProviderMaps();
  for (Map.Entry<Map<String, Object>, ? extends Function<String, IResourceServiceProvider>> mapEntry : resourceProvidersMap.entrySet()) {
    Map<String, Object> map = mapEntry.getKey();
    for (Map.Entry<String, Object> entry : map.entrySet()) {
      try {
        IResourceServiceProvider resourceServiceProvider = mapEntry.getValue().apply(entry.getKey());
        if (resourceServiceProvider == null) {
          continue;
        }
        IGrammarAccess grammarAccess = resourceServiceProvider.get(IGrammarAccess.class);
        if (grammarAccess != null && grammarAccess.getGrammar().getName().equals(languageId)) {
          return resourceServiceProvider;
        }
        // CHECKSTYLE:OFF
      } catch (ConfigurationException ex) {
        // CHECKSTYLE:ON
        // ignore
      }
    }
  }
  return null;
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:31,代码来源:ResourceServiceProviderLocator.java


示例15: getAllLanguages

import org.eclipse.xtext.resource.IResourceServiceProvider; //导入依赖的package包/类
/**
 * Gets the all languages available in the workbench.
 *
 * @return set of all languages
 */
public Set<String> getAllLanguages() {
  Set<String> languages = new HashSet<String>();
  for (String extension : Registry.INSTANCE.getExtensionToFactoryMap().keySet()) {
    final URI dummyUri = URI.createURI("foo:/foo." + extension);
    IResourceServiceProvider resourceServiceProvider = Registry.INSTANCE.getResourceServiceProvider(dummyUri);
    // By checking that description manager is AbstractCachingResourceDescriptionManager we exclude technical languages of the framework
    if (resourceServiceProvider != null && resourceServiceProvider.getResourceDescriptionManager() instanceof AbstractCachingResourceDescriptionManager) {
      try {
        IGrammarAccess grammarAccess = resourceServiceProvider.get(IGrammarAccess.class);
        if (grammarAccess != null && grammarAccess.getGrammar() != null) {
          languages.add(grammarAccess.getGrammar().getName());
        }
      } catch (ConfigurationException e) {
        // Will happen if no binding for IGrammarAccess was present.
      }
    }
  }
  return languages;
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:25,代码来源:CheckCfgUtil.java


示例16: resolveCodeLens

import org.eclipse.xtext.resource.IResourceServiceProvider; //导入依赖的package包/类
@Override
public CompletableFuture<CodeLens> resolveCodeLens(final CodeLens unresolved) {
  final URI uri = this.uninstallURI(unresolved);
  if ((uri == null)) {
    return CompletableFuture.<CodeLens>completedFuture(unresolved);
  }
  final Function1<CancelIndicator, CodeLens> _function = (CancelIndicator cancelIndicator) -> {
    final IResourceServiceProvider resourceServiceProvider = this.languagesRegistry.getResourceServiceProvider(uri);
    ICodeLensResolver _get = null;
    if (resourceServiceProvider!=null) {
      _get=resourceServiceProvider.<ICodeLensResolver>get(ICodeLensResolver.class);
    }
    final ICodeLensResolver resolver = _get;
    if ((resolver == null)) {
      return unresolved;
    }
    final Function2<Document, XtextResource, CodeLens> _function_1 = (Document document, XtextResource resource) -> {
      final CodeLens result = resolver.resolveCodeLens(document, resource, unresolved, cancelIndicator);
      return result;
    };
    return this.workspaceManager.<CodeLens>doRead(uri, _function_1);
  };
  return this.requestManager.<CodeLens>runRead(_function);
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:25,代码来源:LanguageServerImpl.java


示例17: register

import org.eclipse.xtext.resource.IResourceServiceProvider; //导入依赖的package包/类
public void register(Injector injector) {
	if (!EPackage.Registry.INSTANCE.containsKey("http://www.baernreuther.de/dsls/Pkmntcgo")) {
		EPackage.Registry.INSTANCE.put("http://www.baernreuther.de/dsls/Pkmntcgo", PkmntcgoPackage.eINSTANCE);
	}
	IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
	IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);
	
	Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("ptcgo", resourceFactory);
	IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("ptcgo", serviceProvider);
}
 
开发者ID:rehne93,项目名称:pokemon-tcgo-deck-generator,代码行数:11,代码来源:PkmntcgoStandaloneSetupGenerated.java


示例18: computeResourceDescription

import org.eclipse.xtext.resource.IResourceServiceProvider; //导入依赖的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


示例19: register

import org.eclipse.xtext.resource.IResourceServiceProvider; //导入依赖的package包/类
public void register(Injector injector) {
	IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
	IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);
	
	Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("n4ts", resourceFactory);
	IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("n4ts", serviceProvider);
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:8,代码来源:TypesStandaloneSetupGenerated.java


示例20: register

import org.eclipse.xtext.resource.IResourceServiceProvider; //导入依赖的package包/类
public void register(Injector injector) {
	if (!EPackage.Registry.INSTANCE.containsKey("http://www.eclipse.org/n4js/regex/RegularExpression")) {
		EPackage.Registry.INSTANCE.put("http://www.eclipse.org/n4js/regex/RegularExpression", RegularExpressionPackage.eINSTANCE);
	}
	IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
	IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);
	
	Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("regex", resourceFactory);
	IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("regex", serviceProvider);
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:11,代码来源:RegularExpressionStandaloneSetupGenerated.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SQLType类代码示例发布时间:2022-05-21
下一篇:
Java JSONObject类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap