Merge pull request #702 from sailingKieler/aa/ecore2XtextValueConverterService

[xtext generator] Migrated 'Ecore2XtextValueConverterServiceFragment'
This commit is contained in:
Stefan Oehme 2015-10-22 10:41:44 +02:00
commit a058fd1072
3 changed files with 32 additions and 3 deletions

View file

@ -25,6 +25,7 @@ Import-Package: com.ibm.icu.text;version="4.0.0",
Export-Package: org.eclipse.xtext.xtext.generator,
org.eclipse.xtext.xtext.generator.builder;x-internal:=true,
org.eclipse.xtext.xtext.generator.ecore;x-internal:=true,
org.eclipse.xtext.xtext.generator.ecore2xtext;x-internal:=true,
org.eclipse.xtext.xtext.generator.exporting;x-internal:=true,
org.eclipse.xtext.xtext.generator.formatting;x-internal:=true,
org.eclipse.xtext.xtext.generator.generator;x-internal:=true,

View file

@ -0,0 +1,29 @@
/*******************************************************************************
* Copyright (c) 2015 itemis AG (http://www.itemis.eu) and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/
package org.eclipse.xtext.xtext.generator.ecore2xtext
import org.eclipse.xtext.common.services.Ecore2XtextTerminalConverters
import org.eclipse.xtext.conversion.IValueConverterService
import org.eclipse.xtext.xtext.generator.model.GuiceModuleAccess
import static extension org.eclipse.xtext.xtext.generator.model.TypeReference.*
import org.eclipse.xtext.xtext.generator.AbstractXtextGeneratorFragment
/**
* Contributes the registration of the {@link Ecore2XtextTerminalConverters}.
*
* @author Christian Schneider - Initial contribution and API
*/
class Ecore2XtextValueConverterServiceFragment2 extends AbstractXtextGeneratorFragment {
override generate() {
new GuiceModuleAccess.BindingFactory()
.addTypeToType(IValueConverterService.typeRef(), Ecore2XtextTerminalConverters.typeRef())
.contributeTo(language.runtimeGenModule)
}
}

View file

@ -218,9 +218,8 @@ class RuntimeProjectDescriptor extends TestedProjectDescriptor {
«ENDIF»
«IF fromExistingEcoreModels»
fragment = adapter.FragmentAdapter {
fragment = ecore2xtext.Ecore2XtextValueConverterServiceFragment {}
}
fragment = ecore2xtext.Ecore2XtextValueConverterServiceFragment2 auto-inject {}
fragment = adapter.FragmentAdapter {
fragment = ecore2xtext.FormatterFragment {}
}