Просмотр исходного кода

Removed deprecated NamespaceLocalScopeResolver class

Andreas Mülder 13 лет назад
Родитель
Сommit
8a8aa72f64

+ 10 - 19
plugins/org.yakindu.sct.model.stext/src/org/yakindu/sct/model/stext/STextRuntimeModule.java

@@ -1,22 +1,26 @@
+/**
+ * Copyright (c) 2011 committers of YAKINDU and others.
+ * 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:
+ *     committers of YAKINDU - initial API and implementation
+ */
 package org.yakindu.sct.model.stext;
 
 import org.eclipse.xtext.linking.ILinker;
 import org.eclipse.xtext.naming.IQualifiedNameProvider;
-import org.eclipse.xtext.scoping.IScopeProvider;
-import org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider;
 import org.yakindu.base.types.ITypeSystemAccess;
 import org.yakindu.base.types.impl.BaseTypeSystemAccessImpl;
 import org.yakindu.sct.model.sgraph.resource.SCTLinker;
 import org.yakindu.sct.model.stext.conversion.StextValueConverterService;
 import org.yakindu.sct.model.stext.naming.StextNameProvider;
-import org.yakindu.sct.model.stext.scoping.NamespaceLocalScopeResolver;
 import org.yakindu.sct.model.stext.scoping.STextGlobalScopeProvider;
 import org.yakindu.sct.model.stext.validation.ITypeInferrer;
 import org.yakindu.sct.model.stext.validation.TypeInferrer;
 
-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.
@@ -35,10 +39,6 @@ public class STextRuntimeModule extends
 	public Class<? extends ILinker> bindILinker() {
 		return SCTLinker.class;
 	}
-	
-	// public Class<? extends LazyURIEncoder> bindLazyURIEncoder() {
-	// return SCTLazyURIEncoder.class;
-	// }
 
 	@Override
 	public Class<? extends IQualifiedNameProvider> bindIQualifiedNameProvider() {
@@ -58,13 +58,4 @@ public class STextRuntimeModule extends
 		return TypeInferrer.class;
 	}
 
-	// contributed by
-	// org.eclipse.xtext.generator.scoping.AbstractScopingFragment
-	public void configureIScopeProviderDelegate(Binder binder) {
-		binder.bind(IScopeProvider.class)
-				.annotatedWith(
-						Names.named(AbstractDeclarativeScopeProvider.NAMED_DELEGATE))
-				.to(NamespaceLocalScopeResolver.class);
-	}
-
 }

+ 0 - 48
plugins/org.yakindu.sct.model.stext/src/org/yakindu/sct/model/stext/scoping/NamespaceLocalScopeResolver.java

@@ -1,48 +0,0 @@
-/**
- * Copyright (c) 2011 committers of YAKINDU and others.
- * 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:
- *     committers of YAKINDU - initial API and implementation
- */
-package org.yakindu.sct.model.stext.scoping;
-
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.xtext.EcoreUtil2;
-import org.eclipse.xtext.naming.IQualifiedNameConverter;
-import org.eclipse.xtext.scoping.impl.ImportNormalizer;
-import org.eclipse.xtext.scoping.impl.ImportedNamespaceAwareLocalScopeProvider;
-import org.eclipse.xtext.util.Strings;
-import org.yakindu.sct.model.sgraph.Statechart;
-
-import com.google.inject.Inject;
-
-public class NamespaceLocalScopeResolver extends
-		ImportedNamespaceAwareLocalScopeProvider {
-	@Inject
-	IQualifiedNameConverter nameConverter;
-
-	@Override
-	protected List<ImportNormalizer> internalGetImportedNamespaceResolvers(
-			EObject context, boolean ignoreCase) {
-		List<ImportNormalizer> namespaceResolvers = super
-				.internalGetImportedNamespaceResolvers(context, ignoreCase);
-		// TODO The elements could be in a new 'FakeResource' and are not below
-		// a statechart while editing
-		Statechart statechart = EcoreUtil2.getContainerOfType(context,
-				Statechart.class);
-		if (statechart != null) {
-			if (!Strings.isEmpty(statechart.getNamespace())) {
-				namespaceResolvers.add(new ImportNormalizer(nameConverter
-								.toQualifiedName(statechart.getNamespace()),
-								true, true));
-			}
-		}
-		return namespaceResolvers;
-	}
-}