| /** |
| * |
| * 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 |
| * |
| * This copyright notice shows up in the generated Java code |
| * |
| */ |
| package org.eclipse.osbp.xtext.oxtype.scoping.eobject |
| |
| import java.util.Collections |
| import java.util.Set |
| import org.eclipse.xtext.naming.QualifiedName |
| import org.eclipse.xtext.resource.IEObjectDescription |
| import org.eclipse.xtext.scoping.IScope |
| import org.eclipse.xtext.scoping.impl.AbstractScope |
| |
| /** |
| * Records the scope for all qualified names |
| */ |
| class RecordingEObjectScope extends AbstractScope { |
| |
| private final Set<QualifiedName> importedNames; |
| |
| new(IScope parent, boolean ignoreCase, Set<QualifiedName> importedNames) { |
| super(parent, ignoreCase); |
| this.importedNames = importedNames; |
| } |
| |
| override IEObjectDescription getSingleElement(QualifiedName name) { |
| importedNames.add(name.toLowerCase()); |
| return super.getSingleElement(name); |
| } |
| |
| override protected getAllLocalElements() { |
| Collections.emptyList |
| } |
| |
| } |