protected IScope createReferencedPackagesScope(PatternModel model) { final Collection<EClassifier> allClassifiers = new ArrayList<EClassifier>(); for (PackageImport decl : model.getImportPackages()) { if (decl.getEPackage() != null) { allClassifiers.addAll(decl.getEPackage().getEClassifiers()); } } return createClassifierScope(allClassifiers); }
public IScope scope_EEnum(EnumValue ctx, EReference ref) { PatternModel model = (PatternModel) getRootContainer(ctx); final Collection<EEnum> enums = Lists.newArrayList(); for (PackageImport decl : model.getImportPackages()) { if (decl.getEPackage() != null) { Iterables.addAll( enums, Iterables.filter(decl.getEPackage().getEClassifiers(), EEnum.class)); } } return Scopes.scopeFor(enums); }