|
@@ -23,6 +23,7 @@ import org.eclipse.xtext.scoping.impl.AbstractScope;
|
|
|
import org.yakindu.base.types.ITypeSystemRegistry;
|
|
|
import org.yakindu.base.types.typesystem.ITypeSystem;
|
|
|
import org.yakindu.sct.domain.extension.DefaultDomain;
|
|
|
+import org.yakindu.sct.model.sgraph.Statechart;
|
|
|
|
|
|
import com.google.common.collect.Iterables;
|
|
|
import com.google.common.collect.Lists;
|
|
@@ -37,12 +38,15 @@ public class TypeSystemAwareScope extends AbstractScope {
|
|
|
|
|
|
private String domainID;
|
|
|
|
|
|
+ private Statechart context;
|
|
|
+
|
|
|
public TypeSystemAwareScope(IScope parent, ITypeSystemRegistry typeSystemAccess,
|
|
|
- IQualifiedNameProvider qualifiedNameProvider, EClass eClass, String domainID) {
|
|
|
+ IQualifiedNameProvider qualifiedNameProvider, EClass eClass, String domainID, Statechart context) {
|
|
|
super(parent, false);
|
|
|
this.typeSystemAccess = typeSystemAccess;
|
|
|
this.qualifiedNameProvider = qualifiedNameProvider;
|
|
|
this.eClass = eClass;
|
|
|
+ this.context = context;
|
|
|
this.domainID = domainID != null ? domainID : DefaultDomain.DOMAIN_ID;
|
|
|
}
|
|
|
|
|
@@ -51,10 +55,11 @@ public class TypeSystemAwareScope extends AbstractScope {
|
|
|
List<IEObjectDescription> result = Lists.newArrayList();
|
|
|
Iterable<ITypeSystem> allTypeSystems = typeSystemAccess.getTypeSystems(domainID);
|
|
|
for (ITypeSystem iTypeSystem : allTypeSystems) {
|
|
|
- Iterable<IEObjectDescription> iterable = Scopes.scopedElementsFor(
|
|
|
- EcoreUtil2.<EObject> getObjectsByType(iTypeSystem.getTypes(), eClass), qualifiedNameProvider);
|
|
|
+ Iterable<IEObjectDescription> iterable = Scopes
|
|
|
+ .scopedElementsFor(EcoreUtil2.<EObject> getObjectsByType(iTypeSystem.getTypes(context), eClass),
|
|
|
+ qualifiedNameProvider);
|
|
|
Iterables.addAll(result, iterable);
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
-}
|
|
|
+}
|