org.eclipse.xtext.resource.IResourceFactory Java Examples
The following examples show how to use
org.eclipse.xtext.resource.IResourceFactory.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DuplicateResourceAwareFileSetupContext.java From n4js with Eclipse Public License 1.0 | 6 votes |
/** {@inheritDoc} */ @Override public Resource load(final ResourceSet resourceSet, final URI uri, final InputStream input) throws IOException { final Injector injector = IXtInjectorProvider.INSTANCE.getInjector(context.get(XpectJavaModel.class), uri); final Resource resource = injector.getInstance(IResourceFactory.class).createResource(uri); final Resource existingResousce = from(resourceSet.getResources()) .firstMatch(r -> r.getURI().equals(resource.getURI())).orNull(); if (null != existingResousce) { // remove the existing one resourceSet.getResources().remove(existingResousce); } resourceSet.getResources().add(resource); try { resource.load(input, null); } finally { if (input != null) input.close(); } return resource; }
Example #2
Source File: RegistryProvider.java From smarthome with Eclipse Public License 2.0 | 6 votes |
private void register(IResourceServiceProvider.Registry registry, Injector injector) { IResourceServiceProvider resourceServiceProvider = injector.getInstance(IResourceServiceProvider.class); FileExtensionProvider extensionProvider = injector.getInstance(FileExtensionProvider.class); for (String ext : extensionProvider.getFileExtensions()) { if (registry.getExtensionToFactoryMap().containsKey(ext)) { if (extensionProvider.getPrimaryFileExtension() == ext) { registry.getExtensionToFactoryMap().put(ext, resourceServiceProvider); } } else { registry.getExtensionToFactoryMap().put(ext, resourceServiceProvider); } IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class); Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(ext, resourceFactory); } }
Example #3
Source File: N4JSStandaloneSetupGenerated.java From n4js with Eclipse Public License 1.0 | 6 votes |
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); Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("n4idl", resourceFactory); IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("n4idl", serviceProvider); }
Example #4
Source File: ContentAssistNoTerminalExtensionTestLanguageStandaloneSetupGenerated.java From xtext-eclipse with Eclipse Public License 2.0 | 5 votes |
public void register(Injector injector) { if (!EPackage.Registry.INSTANCE.containsKey("http://www.eclipse.org/xtext/ui/common/tests/2018/contentAssistNoTerminalExtension")) { EPackage.Registry.INSTANCE.put("http://www.eclipse.org/xtext/ui/common/tests/2018/contentAssistNoTerminalExtension", NoTerminalExtensionPackage.eINSTANCE); } IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class); IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class); Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("contentassistnoterminalextensiontestlanguage", resourceFactory); IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("contentassistnoterminalextensiontestlanguage", serviceProvider); }
Example #5
Source File: Bug301935ExTestLanguageStandaloneSetupGenerated.java From xtext-core with Eclipse Public License 2.0 | 5 votes |
public void register(Injector injector) { IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class); IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class); Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("bug301935extestlanguage", resourceFactory); IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("bug301935extestlanguage", serviceProvider); }
Example #6
Source File: EpatchTestLanguageStandaloneSetupGenerated.java From xtext-core with Eclipse Public License 2.0 | 5 votes |
public void register(Injector injector) { IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class); IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class); Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("epatchtestlanguage", resourceFactory); IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("epatchtestlanguage", serviceProvider); if (!EPackage.Registry.INSTANCE.containsKey("http://www.eclipse.org/2008/tmf/xtext/EpatchTestLanguage")) { EPackage.Registry.INSTANCE.put("http://www.eclipse.org/2008/tmf/xtext/EpatchTestLanguage", EpatchTestLanguagePackage.eINSTANCE); } }
Example #7
Source File: IndentationAwareTestLanguageStandaloneSetupGenerated.java From xtext-core with Eclipse Public License 2.0 | 5 votes |
public void register(Injector injector) { IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class); IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class); Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("indentationawaretestlanguage", resourceFactory); IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("indentationawaretestlanguage", serviceProvider); if (!EPackage.Registry.INSTANCE.containsKey("http://example.xtext.org/IndentationAwareTestLanguage")) { EPackage.Registry.INSTANCE.put("http://example.xtext.org/IndentationAwareTestLanguage", IndentLangPackage.eINSTANCE); } }
Example #8
Source File: Ecore2XtextTestStandaloneSetupGenerated.java From xtext-eclipse with Eclipse Public License 2.0 | 5 votes |
public void register(Injector injector) { IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class); IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class); Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("ecore2xtexttest", resourceFactory); IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("ecore2xtexttest", serviceProvider); }
Example #9
Source File: CodetemplatesStandaloneSetupGenerated.java From xtext-eclipse with Eclipse Public License 2.0 | 5 votes |
public void register(Injector injector) { if (!EPackage.Registry.INSTANCE.containsKey("http://www.eclipse.org/xtext/codetemplate/Codetemplates")) { EPackage.Registry.INSTANCE.put("http://www.eclipse.org/xtext/codetemplate/Codetemplates", TemplatesPackage.eINSTANCE); } IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class); IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class); Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("codetemplates", resourceFactory); IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("codetemplates", serviceProvider); }
Example #10
Source File: Bug250313StandaloneSetupGenerated.java From xtext-core with Eclipse Public License 2.0 | 5 votes |
public void register(Injector injector) { IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class); IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class); Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("bug250313", resourceFactory); IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("bug250313", serviceProvider); if (!EPackage.Registry.INSTANCE.containsKey("http://org.eclipse.xtext.valueconverter.Bug250313")) { EPackage.Registry.INSTANCE.put("http://org.eclipse.xtext.valueconverter.Bug250313", Bug250313Package.eINSTANCE); } }
Example #11
Source File: QuickfixCrossrefTestLanguageStandaloneSetupGenerated.java From xtext-eclipse with Eclipse Public License 2.0 | 5 votes |
public void register(Injector injector) { if (!EPackage.Registry.INSTANCE.containsKey("http://eclipse.org/xtext/quickfixCrossrefTestLanguage")) { EPackage.Registry.INSTANCE.put("http://eclipse.org/xtext/quickfixCrossrefTestLanguage", QuickfixCrossrefPackage.eINSTANCE); } IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class); IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class); Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("quickfixcrossreftestlanguage", resourceFactory); IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("quickfixcrossreftestlanguage", serviceProvider); }
Example #12
Source File: ExUnorderedGroupsTestLanguageStandaloneSetupGenerated.java From xtext-core with Eclipse Public License 2.0 | 5 votes |
public void register(Injector injector) { IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class); IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class); Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("exunorderedgroupstestlanguage", resourceFactory); IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("exunorderedgroupstestlanguage", serviceProvider); }
Example #13
Source File: KeywordsTestLanguageStandaloneSetupGenerated.java From xtext-core with Eclipse Public License 2.0 | 5 votes |
public void register(Injector injector) { IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class); IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class); Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("keywordstestlanguage", resourceFactory); IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("keywordstestlanguage", serviceProvider); if (!EPackage.Registry.INSTANCE.containsKey("http://www.eclipse.org/2009/tmf/xtext/KeywordsTestLanguage")) { EPackage.Registry.INSTANCE.put("http://www.eclipse.org/2009/tmf/xtext/KeywordsTestLanguage", KeywordsTestLanguagePackage.eINSTANCE); } }
Example #14
Source File: ParameterizedExpressionsTestLanguageStandaloneSetupGenerated.java From xtext-eclipse with Eclipse Public License 2.0 | 5 votes |
public void register(Injector injector) { if (!EPackage.Registry.INSTANCE.containsKey("http://www.eclipse.org/2017/tmf/xtext/parameterizedExpressions")) { EPackage.Registry.INSTANCE.put("http://www.eclipse.org/2017/tmf/xtext/parameterizedExpressions", ParameterizedExpressionsTestLanguagePackage.eINSTANCE); } IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class); IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class); Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("parameterizedexpressionstestlanguage", resourceFactory); IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("parameterizedexpressionstestlanguage", serviceProvider); }
Example #15
Source File: ContentAssistContextTestLanguageStandaloneSetupGenerated.java From xtext-eclipse with Eclipse Public License 2.0 | 5 votes |
public void register(Injector injector) { if (!EPackage.Registry.INSTANCE.containsKey("http://www.eclipse.org/xtext/ui/common/tests/2009/contentAssistContextTest")) { EPackage.Registry.INSTANCE.put("http://www.eclipse.org/xtext/ui/common/tests/2009/contentAssistContextTest", ContentAssistContextTestPackage.eINSTANCE); } IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class); IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class); Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("contentassistcontexttestlanguage", resourceFactory); IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("contentassistcontexttestlanguage", serviceProvider); }
Example #16
Source File: Bug360834TestLanguageStandaloneSetupGenerated.java From xtext-eclipse with Eclipse Public License 2.0 | 5 votes |
public void register(Injector injector) { if (!EPackage.Registry.INSTANCE.containsKey("http://www.eclipse.org/xtext/ui/common/tests/2011/bug360834TestLanguage")) { EPackage.Registry.INSTANCE.put("http://www.eclipse.org/xtext/ui/common/tests/2011/bug360834TestLanguage", Bug360834TestLanguagePackage.eINSTANCE); } IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class); IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class); Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("bug360834testlanguage", resourceFactory); IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("bug360834testlanguage", serviceProvider); }
Example #17
Source File: AbstractTestLanguageStandaloneSetupGenerated.java From xtext-core with Eclipse Public License 2.0 | 5 votes |
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); }
Example #18
Source File: Bug296889TestLanguageStandaloneSetupGenerated.java From xtext-core with Eclipse Public License 2.0 | 5 votes |
public void register(Injector injector) { IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class); IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class); Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("bug296889testlanguage", resourceFactory); IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("bug296889testlanguage", serviceProvider); if (!EPackage.Registry.INSTANCE.containsKey("http://eclipse.org/xtext/Bug296889TestLanguage")) { EPackage.Registry.INSTANCE.put("http://eclipse.org/xtext/Bug296889TestLanguage", Bug296889TestPackage.eINSTANCE); } }
Example #19
Source File: InheritanceTest2LanguageStandaloneSetupGenerated.java From xtext-core with Eclipse Public License 2.0 | 5 votes |
public void register(Injector injector) { IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class); IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class); Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("inheritancetest2language", resourceFactory); IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("inheritancetest2language", serviceProvider); if (!EPackage.Registry.INSTANCE.containsKey("http://www.eclipse.org/2009/tmf/xtext/InheritanceTest2Language")) { EPackage.Registry.INSTANCE.put("http://www.eclipse.org/2009/tmf/xtext/InheritanceTest2Language", InheritanceTest2Package.eINSTANCE); } }
Example #20
Source File: LookAheadContentAssistTestLanguageStandaloneSetupGenerated.java From xtext-eclipse with Eclipse Public License 2.0 | 5 votes |
public void register(Injector injector) { if (!EPackage.Registry.INSTANCE.containsKey("http://www.eclipse.org/xtext/ui/common/tests/2009/lookAheadContentAssistTest")) { EPackage.Registry.INSTANCE.put("http://www.eclipse.org/xtext/ui/common/tests/2009/lookAheadContentAssistTest", LookAheadContentAssistTestPackage.eINSTANCE); } IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class); IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class); Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("lookaheadcontentassisttestlanguage", resourceFactory); IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("lookaheadcontentassisttestlanguage", serviceProvider); }
Example #21
Source File: ParametersTestLanguageStandaloneSetupGenerated.java From xtext-eclipse with Eclipse Public License 2.0 | 5 votes |
public void register(Injector injector) { if (!EPackage.Registry.INSTANCE.containsKey("http://www.eclipse.org/2015/tmf/xtext/parameters")) { EPackage.Registry.INSTANCE.put("http://www.eclipse.org/2015/tmf/xtext/parameters", ParametersTestLanguagePackage.eINSTANCE); } IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class); IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class); Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("parameterstestlanguage", resourceFactory); IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("parameterstestlanguage", serviceProvider); }
Example #22
Source File: ActionTestLanguageStandaloneSetupGenerated.java From xtext-core with Eclipse Public License 2.0 | 5 votes |
public void register(Injector injector) { IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class); IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class); Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("actiontestlanguage", resourceFactory); IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("actiontestlanguage", serviceProvider); if (!EPackage.Registry.INSTANCE.containsKey("http://www.eclipse.org/2008/tmf/xtext/ActionLang")) { EPackage.Registry.INSTANCE.put("http://www.eclipse.org/2008/tmf/xtext/ActionLang", ActionLangPackage.eINSTANCE); } }
Example #23
Source File: ImportUriTestLanguageStandaloneSetupGenerated.java From xtext-core with Eclipse Public License 2.0 | 5 votes |
public void register(Injector injector) { IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class); IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class); Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("importuritestlanguage", resourceFactory); IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("importuritestlanguage", serviceProvider); if (!EPackage.Registry.INSTANCE.containsKey("http://eclipse.org/xtext/importUriTestLanguage")) { EPackage.Registry.INSTANCE.put("http://eclipse.org/xtext/importUriTestLanguage", ImportedURIPackage.eINSTANCE); } }
Example #24
Source File: Bug286935TestLanguageStandaloneSetupGenerated.java From xtext-eclipse with Eclipse Public License 2.0 | 5 votes |
public void register(Injector injector) { if (!EPackage.Registry.INSTANCE.containsKey("http://www.eclipse.org/xtext/ui/common/tests/2009/bug286935TestLanguage")) { EPackage.Registry.INSTANCE.put("http://www.eclipse.org/xtext/ui/common/tests/2009/bug286935TestLanguage", Bug286935TestLanguagePackage.eINSTANCE); } IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class); IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class); Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("bug286935testlanguage", resourceFactory); IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("bug286935testlanguage", serviceProvider); }
Example #25
Source File: MetamodelRefTestLanguageStandaloneSetupGenerated.java From xtext-core with Eclipse Public License 2.0 | 5 votes |
public void register(Injector injector) { IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class); IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class); Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("metamodelreftestlanguage", resourceFactory); IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("metamodelreftestlanguage", serviceProvider); if (!EPackage.Registry.INSTANCE.containsKey("http://eclipse.org/xtext/tests/AnotherSimpleTest")) { EPackage.Registry.INSTANCE.put("http://eclipse.org/xtext/tests/AnotherSimpleTest", AnotherSimpleTestPackage.eINSTANCE); } }
Example #26
Source File: Bug299395TestLanguageStandaloneSetupGenerated.java From xtext-core with Eclipse Public License 2.0 | 5 votes |
public void register(Injector injector) { IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class); IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class); Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("bug299395testlanguage", resourceFactory); IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("bug299395testlanguage", serviceProvider); if (!EPackage.Registry.INSTANCE.containsKey("http://www.eclipse.org/2010/tmf/xtext/Bug299395")) { EPackage.Registry.INSTANCE.put("http://www.eclipse.org/2010/tmf/xtext/Bug299395", Bug299395Package.eINSTANCE); } }
Example #27
Source File: Bug289524TestLanguageStandaloneSetupGenerated.java From xtext-core with Eclipse Public License 2.0 | 5 votes |
public void register(Injector injector) { IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class); IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class); Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("bug289524testlanguage", resourceFactory); IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("bug289524testlanguage", serviceProvider); if (!EPackage.Registry.INSTANCE.containsKey("http://eclipse.org/xtext/Bug289524TestLanguage")) { EPackage.Registry.INSTANCE.put("http://eclipse.org/xtext/Bug289524TestLanguage", Bug289524TestPackage.eINSTANCE); } }
Example #28
Source File: Bug347012TestLanguageStandaloneSetupGenerated.java From xtext-eclipse with Eclipse Public License 2.0 | 5 votes |
public void register(Injector injector) { if (!EPackage.Registry.INSTANCE.containsKey("http://www.eclipse.org/xtext/ui/common/tests/2011/bug347012TestLanguage")) { EPackage.Registry.INSTANCE.put("http://www.eclipse.org/xtext/ui/common/tests/2011/bug347012TestLanguage", Bug347012TestLanguagePackage.eINSTANCE); } IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class); IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class); Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("bug347012testlanguage", resourceFactory); IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("bug347012testlanguage", serviceProvider); }
Example #29
Source File: XtendStandaloneSetupGenerated.java From xtext-xtend with Eclipse Public License 2.0 | 5 votes |
public void register(Injector injector) { IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class); IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class); Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("xtend", resourceFactory); IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("xtend", serviceProvider); }
Example #30
Source File: TreeTestLanguageStandaloneSetupGenerated.java From xtext-core with Eclipse Public License 2.0 | 5 votes |
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); } }