Java 类org.eclipse.xtext.resource.IResourceServiceProvider 实例源码

项目:n4js    文件:N4HeadlessCompiler.java   
/**
 * 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);
        }
    }
}
项目:n4js    文件:OwnResourceValidatorAwareValidatingEditorCallback.java   
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);
        });
    }
项目:n4js    文件:ReferenceFinderLabelProvider.java   
/**
 * 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);
}
项目:xtext-core    文件:LanguageServerImpl.java   
@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);
}
项目:xtext-core    文件:LanguageServerImpl.java   
@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);
}
项目:xtext-extras    文件:JavaSourceLanguageRuntimeModule.java   
@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);
}
项目:xtext-core    文件:LanguageServerImpl.java   
@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);
}
项目:xtext-core    文件:AbstractResourceServiceProviderDescriptor.java   
@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);
}
项目:xtext-core    文件:LoadOnDemandResourceDescriptions.java   
@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;
}
项目:xtext-core    文件:WorkspaceSymbolService.java   
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;
}
项目:xtext-core    文件:ReferenceAcceptor.java   
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();
  }
}
项目:xtext-core    文件:LanguageServerImpl.java   
@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);
}
项目:xtext-core    文件:LanguageServerImpl.java   
@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);
}
项目:dsl-devkit    文件:ResourceServiceProviderLocator.java   
/**
 * 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;
}
项目:dsl-devkit    文件:CheckCfgUtil.java   
/**
 * 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;
}
项目:xtext-core    文件:LanguageServerImpl.java   
@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);
}
项目:pokemon-tcgo-deck-generator    文件:PkmntcgoStandaloneSetupGenerated.java   
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);
}
项目:n4js    文件:EagerResourceSetBasedResourceDescriptions.java   
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);
}
项目:n4js    文件:TypesStandaloneSetupGenerated.java   
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);
}
项目:n4js    文件:RegularExpressionStandaloneSetupGenerated.java   
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);
}
项目:n4js    文件:TestDiscoveryUIUtils.java   
private static EObject getSelectedElement(final XtextEditor editor, final ITextSelection textSelection) {
    return editor.getDocument().modify(
            resource -> {
                final IResourceServiceProvider serviceProvider = resource.getResourceServiceProvider();
                final EObjectAtOffsetHelper offsetHelper = serviceProvider.get(EObjectAtOffsetHelper.class);
                return offsetHelper.resolveElementAt(resource, textSelection.getOffset());
            });
}
项目:n4js    文件:N4JSStandaloneSetupGenerated.java   
public void register(Injector injector) {
    IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
    IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);

    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("n4js", resourceFactory);
    IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("n4js", serviceProvider);
    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("n4jsx", resourceFactory);
    IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("n4jsx", serviceProvider);
    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("js", resourceFactory);
    IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("js", serviceProvider);
    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("jsx", resourceFactory);
    IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("jsx", serviceProvider);
    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("n4jsd", resourceFactory);
    IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("n4jsd", serviceProvider);
}
项目:n4js    文件:RegExLiteralConverter.java   
private IParser getRegexParser() {
    if (regexParser == null) {
        // no need for sync since we can also use a new regexParser if concurrent access happens by accident
        IResourceServiceProvider serviceProvider = serviceProviders.getResourceServiceProvider(URI
                .createURI("a.regex"));
        regexParser = serviceProvider.get(IParser.class);
    }
    return regexParser;
}
项目:n4js    文件:N4MFStandaloneSetupGenerated.java   
public void register(Injector injector) {
    IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
    IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);

    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("n4mf", resourceFactory);
    IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("n4mf", serviceProvider);
}
项目:Xtext_Xtend_HTML_Generator    文件:MyDslStandaloneSetupGenerated.java   
public void register(Injector injector) {
    if (!EPackage.Registry.INSTANCE.containsKey("http://www.xtext.org/example/mydsl/MyDsl")) {
        EPackage.Registry.INSTANCE.put("http://www.xtext.org/example/mydsl/MyDsl", MyDslPackage.eINSTANCE);
    }
    IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
    IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);

    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("mensa", resourceFactory);
    IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("mensa", serviceProvider);
}
项目:bromium    文件:BromiumStandaloneSetupGenerated.java   
public void register(Injector injector) {
    if (!EPackage.Registry.INSTANCE.containsKey("http://www.hribol.com/bromium/dsl/Bromium")) {
        EPackage.Registry.INSTANCE.put("http://www.hribol.com/bromium/dsl/Bromium", BromiumPackage.eINSTANCE);
    }
    IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
    IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);

    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("brm", resourceFactory);
    IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("brm", serviceProvider);
}
项目:gw4e.project    文件:DSLPoliciesStandaloneSetupGenerated.java   
public void register(Injector injector) {
    if (!EPackage.Registry.INSTANCE.containsKey("http://www.eclipse.gw4e/dsl/DSLPolicies")) {
        EPackage.Registry.INSTANCE.put("http://www.eclipse.gw4e/dsl/DSLPolicies", DSLPoliciesPackage.eINSTANCE);
    }
    IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
    IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);

    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("policies", resourceFactory);
    IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("policies", serviceProvider);
}
项目:lcdsl    文件:LcDslStandaloneSetupGenerated.java   
public void register(Injector injector) {
    if (!EPackage.Registry.INSTANCE.containsKey("http://www.wamas.com/ide/launching/LcDsl")) {
        EPackage.Registry.INSTANCE.put("http://www.wamas.com/ide/launching/LcDsl", LcDslPackage.eINSTANCE);
    }
    IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
    IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);

    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("lc", resourceFactory);
    IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("lc", serviceProvider);
}
项目:gemoc-studio    文件:DslStandaloneSetupGenerated.java   
public void register(Injector injector) {
    if (!EPackage.Registry.INSTANCE.containsKey("http://www.eclipse.org/gemoc/Dsl")) {
        EPackage.Registry.INSTANCE.put("http://www.eclipse.org/gemoc/Dsl", DslPackage.eINSTANCE);
    }
    IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
    IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);

    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("dsl", resourceFactory);
    IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("dsl", serviceProvider);
}
项目:org.xtext.dsl.restaurante    文件:RestauranteStandaloneSetupGenerated.java   
public void register(Injector injector) {
    if (!EPackage.Registry.INSTANCE.containsKey("http://www.xtext.org/dsl/restaurante/Restaurante")) {
        EPackage.Registry.INSTANCE.put("http://www.xtext.org/dsl/restaurante/Restaurante", RestaurantePackage.eINSTANCE);
    }
    IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
    IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);

    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("rest", resourceFactory);
    IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("rest", serviceProvider);
}
项目:OCCI-Studio    文件:OCCIStandaloneSetupGenerated.java   
public void register(Injector injector) {
    IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
    IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);

    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("occi", resourceFactory);
    IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("occi", serviceProvider);
}
项目:xtext-extras    文件:PureXbaseStandaloneSetupGenerated.java   
public void register(Injector injector) {
    if (!EPackage.Registry.INSTANCE.containsKey("http://www.eclipse.org/xtext/purexbase/PureXbase")) {
        EPackage.Registry.INSTANCE.put("http://www.eclipse.org/xtext/purexbase/PureXbase", PureXbasePackage.eINSTANCE);
    }
    IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
    IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);

    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("xbase", resourceFactory);
    IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("xbase", serviceProvider);
}
项目:xtext-extras    文件:TraceAsSmapInstaller.java   
protected String getStratumName(final SourceRelativeURI path) {
    IResourceServiceProvider provider = serviceProviderRegistry.getResourceServiceProvider(path.getURI());
    if (provider == null) {
        // it might happen that trace data is in the workspace but the corresponding language is not installed.
        // we use the file extension then.
        String result = path.getURI().fileExtension();
        if (result != null) {
            return result;
        }
        return "unknown";
    }
    final LanguageInfo languageInfo = provider.get(LanguageInfo.class);
    String name = languageInfo.getShortName();
    return name;
}
项目:xtext-extras    文件:XbaseStandaloneSetupGenerated.java   
public void register(Injector injector) {
    IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
    IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);

    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("___xbase", resourceFactory);
    IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("___xbase", serviceProvider);
}
项目:xtext-extras    文件:RefactoringTestLanguageStandaloneSetupGenerated.java   
public void register(Injector injector) {
    if (!EPackage.Registry.INSTANCE.containsKey("http://www.eclipse.org/2011/xtext/ui/common/types/xtext/ui/Refactoring")) {
        EPackage.Registry.INSTANCE.put("http://www.eclipse.org/2011/xtext/ui/common/types/xtext/ui/Refactoring", RefactoringTestLanguagePackage.eINSTANCE);
    }
    IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
    IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);

    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("typesRefactoring", resourceFactory);
    IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("typesRefactoring", serviceProvider);
}
项目:xtext-core    文件:FormatterTestLanguageStandaloneSetupGenerated.java   
public void register(Injector injector) {
    IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
    IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);

    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("formattertestlanguage", resourceFactory);
    IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("formattertestlanguage", serviceProvider);
    if (!EPackage.Registry.INSTANCE.containsKey("http://formatter2/formattertestlanguage")) {
        EPackage.Registry.INSTANCE.put("http://formatter2/formattertestlanguage", FormattertestlanguagePackage.eINSTANCE);
    }
}
项目:xtext-core    文件:TestLanguageStandaloneSetupGenerated.java   
public void register(Injector injector) {
    IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
    IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);

    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("testlanguage", resourceFactory);
    IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("testlanguage", serviceProvider);
    if (!EPackage.Registry.INSTANCE.containsKey("http://www.eclipse.org/2008/xtext/TestLang")) {
        EPackage.Registry.INSTANCE.put("http://www.eclipse.org/2008/xtext/TestLang", TestLangPackage.eINSTANCE);
    }
}
项目:xtext-core    文件:TreeTestLanguageStandaloneSetupGenerated.java   
public void register(Injector injector) {
    IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
    IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);

    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("treetestlanguage", resourceFactory);
    IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("treetestlanguage", serviceProvider);
    if (!EPackage.Registry.INSTANCE.containsKey("http://www.eclipse.org/2008/tmf/xtext/TreeTestLanguage")) {
        EPackage.Registry.INSTANCE.put("http://www.eclipse.org/2008/tmf/xtext/TreeTestLanguage", TreeTestLanguagePackage.eINSTANCE);
    }
}
项目:xtext-extras    文件:BuilderTestLanguageStandaloneSetupGenerated.java   
public void register(Injector injector) {
    if (!EPackage.Registry.INSTANCE.containsKey("http://eclipse.org/xtext/builderStandaloneTestLanguage")) {
        EPackage.Registry.INSTANCE.put("http://eclipse.org/xtext/builderStandaloneTestLanguage", BuilderTestLanguagePackage.eINSTANCE);
    }
    IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
    IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);

    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("buildertestlanguage", resourceFactory);
    IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("buildertestlanguage", serviceProvider);
}
项目:xtext-core    文件:AbstractTestLanguageStandaloneSetupGenerated.java   
public void register(Injector injector) {
    IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
    IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);

    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("abstracttestlanguage", resourceFactory);
    IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("abstracttestlanguage", serviceProvider);
}