blob: 583d0acb18b2529fe47ce8306ec646a0ab469a68 [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.perspective;
import javax.inject.Singleton;
import org.eclipse.osbp.dsl.xtext.lazyresolver.LazyJvmTypeLinker;
import org.eclipse.osbp.dsl.xtext.lazyresolver.LazyJvmTypeLinkingHelper;
import org.eclipse.osbp.dsl.xtext.lazyresolver.SemanticLoadingResource;
import org.eclipse.osbp.dsl.xtext.lazyresolver.linker.FastLinkingService;
import org.eclipse.osbp.dsl.xtext.lazyresolver.linker.LazyJvmTypeTransientValueService;
import org.eclipse.osbp.xtext.i18n.DSLOutputConfigurationProvider;
import org.eclipse.osbp.xtext.perspective.jvmmodel.PerspectiveModelGenerator;
import org.eclipse.osbp.xtext.perspective.linking.PerspectiveJvmLinkingHelper;
import org.eclipse.osbp.xtext.perspective.scoping.PerspectiveScopeProvider;
import org.eclipse.osbp.xtext.perspective.valueconverter.PerspectiveValueConverterService;
import org.eclipse.xtext.conversion.IValueConverterService;
import org.eclipse.xtext.generator.IGenerator;
import org.eclipse.xtext.generator.IOutputConfigurationProvider;
import org.eclipse.xtext.linking.ILinkingService;
import org.eclipse.xtext.scoping.IScopeProvider;
import com.google.inject.Binder;
/**
* Use this class to register components to be used at runtime / without the
* Equinox extension registry.
*/
public class PerspectiveDslRuntimeModule extends
org.eclipse.osbp.xtext.perspective.AbstractPerspectiveDslRuntimeModule {
@Override
public Class<? extends IGenerator> bindIGenerator() {
return PerspectiveModelGenerator.class;
}
public Class<? extends IScopeProvider> bindIScopeProvider() {
return PerspectiveScopeProvider.class;
}
public Class<? extends org.eclipse.xtext.xbase.scoping.batch.XbaseBatchScopeProvider> bindXbaseBatchScopeProvider() {
return PerspectiveScopeProvider.class;
}
// contributed by org.eclipse.xtext.generator.xbase.XbaseGeneratorFragment
public void configureSerializerIScopeProvider(
com.google.inject.Binder binder) {
binder.bind(org.eclipse.xtext.scoping.IScopeProvider.class)
.annotatedWith(
org.eclipse.xtext.serializer.tokens.SerializerScopeProviderBinding.class)
.to(PerspectiveScopeProvider.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 PerspectiveQualifiedNameProvider.class;
// }
@Override
public Class<? extends IValueConverterService> bindIValueConverterService() {
return PerspectiveValueConverterService.class;
}
@Override
public void configure(Binder binder) {
super.configure(binder);
binder.bind(IOutputConfigurationProvider.class)
.to(DSLOutputConfigurationProvider.class).in(Singleton.class);
}
public Class<? extends ILinkingService> bindILinkingService() {
return FastLinkingService.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;
}
// @Override
// public Class<? extends IDerivedStateComputer> bindIDerivedStateComputer()
// {
// return PerspectiveModelDerivedStateComputerx.class;
// }
//
public Class<? extends LazyJvmTypeLinkingHelper> bindJvmLinkingHelper() {
return PerspectiveJvmLinkingHelper.class;
}
}