| /** |
| * Copyright (c) 2011, 2015 - Lunifera GmbH (Gross Enzersdorf, Austria), 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: |
| * Florian Pirchner - Initial implementation |
| */ |
| package org.eclipse.osbp.ecview.uisemantics; |
| |
| import org.eclipse.xtext.linking.ILinkingService; |
| import org.eclipse.xtext.scoping.IScopeProvider; |
| import org.eclipse.xtext.xbase.scoping.batch.XbaseBatchScopeProvider; |
| import org.eclipse.osbp.ecview.uisemantics.linking.UiSemanticsLinkingService; |
| import org.eclipse.osbp.ecview.uisemantics.naming.QualifiedNameProvider; |
| import org.eclipse.osbp.ecview.uisemantics.scoping.ScopeProvider; |
| import org.eclipse.osbp.ecview.uisemantics.scoping.UiImportedNamespaceAwareLocalScopeProvider; |
| |
| import com.google.inject.Binder; |
| import com.google.inject.name.Names; |
| |
| /** |
| * Use this class to register components to be used at runtime / without the |
| * Equinox extension registry. |
| */ |
| public class UISemanticsGrammarRuntimeModule extends |
| org.eclipse.osbp.ecview.uisemantics.AbstractUISemanticsGrammarRuntimeModule { |
| |
| public Class<? extends org.eclipse.xtext.naming.IQualifiedNameProvider> bindIQualifiedNameProvider() { |
| return QualifiedNameProvider.class; |
| } |
| |
| @Override |
| public Class<? extends IScopeProvider> bindIScopeProvider() { |
| return ScopeProvider.class; |
| } |
| |
| @Override |
| public Class<? extends XbaseBatchScopeProvider> bindXbaseBatchScopeProvider() { |
| return ScopeProvider.class; |
| } |
| |
| @Override |
| public void configureIScopeProviderDelegate(Binder binder) { |
| binder.bind(IScopeProvider.class) |
| .annotatedWith( |
| Names.named("org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider.delegate")) |
| .to(UiImportedNamespaceAwareLocalScopeProvider.class); |
| } |
| |
| public Class<? extends ILinkingService> bindILinkingService() { |
| return UiSemanticsLinkingService.class; |
| } |
| |
| } |