All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.eclipse.emf.mwe2.language.Mwe2RuntimeModule Maven / Gradle / Ivy

The newest version!
/*******************************************************************************
 * Copyright (c) 2008, 2023 itemis AG (http://www.itemis.eu) and others.
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License 2.0 which is available at
 * http://www.eclipse.org/legal/epl-2.0.
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 *******************************************************************************/
package org.eclipse.emf.mwe2.language;

import org.eclipse.emf.mwe2.language.formatting.Mwe2Formatter;
import org.eclipse.emf.mwe2.language.resource.MweLocationInFileProvider;
import org.eclipse.emf.mwe2.language.resource.MweResourceDescriptionStrategy;
import org.eclipse.emf.mwe2.language.resource.MweResourceSetProvider;
import org.eclipse.emf.mwe2.language.scoping.Mwe2StateBasedContainerManager;
import org.eclipse.emf.mwe2.language.scoping.NamespaceAwareScopeProvider;
import org.eclipse.emf.mwe2.language.scoping.QualifiedNameProvider;
import org.eclipse.emf.mwe2.language.validation.MweRawSuperTypes;
import org.eclipse.xtext.common.types.util.RawSuperTypes;
import org.eclipse.xtext.conversion.IValueConverterService;
import org.eclipse.xtext.formatting.IFormatter;
import org.eclipse.xtext.naming.IQualifiedNameProvider;
import org.eclipse.xtext.resource.IContainer.Manager;
import org.eclipse.xtext.resource.IDefaultResourceDescriptionStrategy;
import org.eclipse.xtext.resource.ILocationInFileProvider;
import org.eclipse.xtext.resource.XtextResourceSet;

import com.google.inject.Provider;

/**
 * Use this class to register components to be used within the IDE.
 */
public class Mwe2RuntimeModule extends org.eclipse.emf.mwe2.language.AbstractMwe2RuntimeModule {

	@Override
	public Class bindIQualifiedNameProvider() {
		return QualifiedNameProvider.class;
	}

	@Override
	public void configureIScopeProviderDelegate(com.google.inject.Binder binder) {
		binder.bind(org.eclipse.xtext.scoping.IScopeProvider.class)
				.annotatedWith(
						com.google.inject.name.Names
								.named("org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider.delegate"))
				.to(NamespaceAwareScopeProvider.class);
	}

	@Override
	public Class bindIValueConverterService() {
		return Mwe2ValueConverters.class;
	}

	@Override
	public Class bindXtextResourceSet() {
		return null;
	}

	public Class> provideXtextResourceSet() {
		return MweResourceSetProvider.class;
	}

	@Override
	public Class bindILocationInFileProvider() {
		return MweLocationInFileProvider.class;
	}

	public Class bindIDefaultResourceDescriptionStrategy() {
		return MweResourceDescriptionStrategy.class;
	}

	@Override
	public Class bindIContainer$Manager() {
		return Mwe2StateBasedContainerManager.class;
	}

	public Class bindRawSuperTypes() {
		return MweRawSuperTypes.class;
	}

	@Override
	public Class bindIFormatter() {
		return Mwe2Formatter.class;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy