| /** |
| * |
| * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) |
| * |
| * 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 |
| * |
| * Contributors: |
| * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation |
| * |
| */ |
| package org.eclipse.osbp.xtext.table; |
| |
| import javax.inject.Singleton; |
| |
| import org.eclipse.xtext.conversion.IValueConverterService; |
| import org.eclipse.xtext.generator.IGenerator; |
| import org.eclipse.xtext.generator.IOutputConfigurationProvider; |
| import org.eclipse.xtext.scoping.IScopeProvider; |
| import org.eclipse.osbp.dsl.xtext.lazyresolver.LazyJvmTypeLinker; |
| import org.eclipse.osbp.dsl.xtext.lazyresolver.SemanticLoadingResource; |
| import org.eclipse.osbp.dsl.xtext.lazyresolver.linker.LazyJvmTypeTransientValueService; |
| |
| import com.google.inject.Binder; |
| |
| import org.eclipse.osbp.xtext.i18n.DSLOutputConfigurationProvider; |
| import org.eclipse.osbp.xtext.table.generator.OutputConfigurationProvider; |
| import org.eclipse.osbp.xtext.table.jvmmodel.TableModelGenerator; |
| import org.eclipse.osbp.xtext.table.scoping.TableScopeProvider; |
| import org.eclipse.osbp.xtext.table.valueconverter.TableQualifiedNameProvider; |
| import org.eclipse.osbp.xtext.table.valueconverter.TableValueConverterService; |
| |
| /** |
| * Use this class to register components to be used at runtime / without the Equinox extension registry. |
| */ |
| public class TableDSLRuntimeModule extends org.eclipse.osbp.xtext.table.AbstractTableDSLRuntimeModule { |
| @Override |
| public Class<? extends IGenerator> bindIGenerator() { |
| return TableModelGenerator.class; |
| } |
| |
| public Class<? extends IScopeProvider> bindIScopeProvider() { |
| return TableScopeProvider.class; |
| } |
| |
| public Class<? extends IOutputConfigurationProvider> bindIOutputConfigurationProvider() { |
| return OutputConfigurationProvider.class; |
| } |
| |
| // /** |
| // * Only required, if fqn can not be created by appending the names of the |
| // * semantic elements up the hierarchy. |
| // */ |
| // public Class<? extends org.eclipse.xtext.naming.IQualifiedNameProvider> bindIQualifiedNameProvider() { |
| // return TableQualifiedNameProvider.class; |
| // } |
| // |
| @Override |
| public Class<? extends IValueConverterService> bindIValueConverterService() { |
| return TableValueConverterService.class; |
| } |
| |
| public Class<? extends org.eclipse.xtext.xbase.scoping.batch.XbaseBatchScopeProvider> bindXbaseBatchScopeProvider() { |
| return TableScopeProvider.class; |
| } |
| |
| // @Override |
| // public void configure(Binder binder) { |
| // super.configure(binder); |
| // binder.bind(IOutputConfigurationProvider.class).to(DSLOutputConfigurationProvider.class).in(Singleton.class); |
| // } |
| |
| public Class<? extends org.eclipse.xtext.resource.XtextResource> bindXtextResource() { |
| return SemanticLoadingResource.class; |
| } |
| |
| public Class<? extends org.eclipse.xtext.linking.ILinker> bindILinker() { |
| return LazyJvmTypeLinker.class; |
| } |
| |
| public Class<? extends org.eclipse.xtext.serializer.sequencer.ITransientValueService> bindSerializerITransientValueService() { |
| return LazyJvmTypeTransientValueService.class; |
| } |
| |
| } |