blob: c80e21d5c6ba8935c41f4a5532f207e7b53d8114 [file] [log] [blame]
/**
*
* 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.action;
import javax.inject.Singleton;
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 org.eclipse.osbp.xtext.action.jvmmodel.ActionModelGenerator;
import org.eclipse.osbp.xtext.action.scoping.ActionScopeProvider;
import org.eclipse.osbp.xtext.action.valueconverter.ActionValueConverterService;
import org.eclipse.osbp.xtext.i18n.DSLOutputConfigurationProvider;
import org.eclipse.xtext.conversion.IValueConverterService;
import org.eclipse.xtext.generator.IGenerator;
import org.eclipse.xtext.generator.IOutputConfigurationProvider;
import org.eclipse.xtext.resource.XtextResource;
import org.eclipse.xtext.scoping.IScopeProvider;
import org.eclipse.xtext.xbase.scoping.batch.XbaseBatchScopeProvider;
import com.google.inject.Binder;
/**
* Use this class to register components to be used at runtime / without the
* Equinox extension registry.
*/
public class ActionDSLRuntimeModule extends
org.eclipse.osbp.xtext.action.AbstractActionDSLRuntimeModule {
@Override
public Class<? extends IGenerator> bindIGenerator() {
return ActionModelGenerator.class;
}
@Override
public Class<? extends IScopeProvider> bindIScopeProvider() {
return ActionScopeProvider.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 ActionQualifiedNameProvider.class;
// }
//
@Override
public Class<? extends IValueConverterService> bindIValueConverterService() {
return ActionValueConverterService.class;
}
@Override
public void configure(Binder binder) {
super.configure(binder);
binder.bind(IOutputConfigurationProvider.class)
.to(DSLOutputConfigurationProvider.class).in(Singleton.class);
}
@Override
public Class<? extends 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;
}
@Override
public Class<? extends XbaseBatchScopeProvider> bindXbaseBatchScopeProvider() {
return ActionScopeProvider.class;
}
}