| /** |
| * |
| * 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 2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Contributors: |
| * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation |
| * |
| */ |
| package org.eclipse.osbp.xtext.strategy; |
| |
| import javax.inject.Singleton; |
| |
| import org.eclipse.osbp.xtext.i18n.DSLOutputConfigurationProvider; |
| import org.eclipse.osbp.xtext.strategy.formatting.StrategyDSLFormatter; |
| import org.eclipse.osbp.xtext.strategy.generator.StrategyDSLGenerator; |
| import org.eclipse.osbp.xtext.strategy.scoping.StrategyDSLScopeProvider; |
| import org.eclipse.osbp.xtext.strategy.valueconverter.StrategyQualifiedNameProvider; |
| import org.eclipse.xtext.findReferences.TargetURICollector; |
| import org.eclipse.xtext.generator.IGenerator; |
| import org.eclipse.xtext.generator.IOutputConfigurationProvider; |
| import org.eclipse.xtext.naming.IQualifiedNameProvider; |
| import org.eclipse.xtext.resource.persistence.IResourceStorageFacade; |
| import org.eclipse.xtext.scoping.IScopeProvider; |
| import org.eclipse.xtext.xbase.jvmmodel.JvmModelTargetURICollector; |
| import org.eclipse.xtext.xbase.resource.BatchLinkableResourceStorageFacade; |
| |
| import com.google.inject.Binder; |
| |
| /** |
| * Use this class to register components to be used at runtime / without the |
| * Equinox extension registry. |
| */ |
| public class StrategyDSLRuntimeModule extends |
| org.eclipse.osbp.xtext.strategy.AbstractStrategyDSLRuntimeModule { |
| |
| public Class<? extends IResourceStorageFacade> bindResourceStorageFacade() { |
| return BatchLinkableResourceStorageFacade.class; |
| } |
| |
| public Class<? extends TargetURICollector> bindTargetURICollector() { |
| return JvmModelTargetURICollector.class; |
| } |
| |
| @Override |
| public Class<? extends IGenerator> bindIGenerator() { |
| return StrategyDSLGenerator.class; |
| } |
| |
| public Class<? extends org.eclipse.xtext.formatting.IFormatter> bindIFormatter() { |
| return StrategyDSLFormatter.class; |
| } |
| |
| @Override |
| public Class<? extends IScopeProvider> bindIScopeProvider() { |
| return StrategyDSLScopeProvider.class; |
| } |
| |
| @Override |
| public void configure(Binder binder) { |
| super.configure(binder); |
| binder.bind(IOutputConfigurationProvider.class) |
| .to(DSLOutputConfigurationProvider.class).in(Singleton.class); |
| } |
| |
| @Override |
| public Class<? extends IQualifiedNameProvider> bindIQualifiedNameProvider() { |
| return StrategyQualifiedNameProvider.class; |
| } |
| |
| } |