blob: f7e8e9a8c2477478c88d504345b2d0fdbe391c5e [file] [log] [blame]
/**
*
* Copyright (c) 2011, 2016 - 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 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
*
* generated by Xtext 2.11.0
*
*/
package org.eclipse.osbp.xtext.cubedsl.imports;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.osbp.dsl.semantic.entity.LEntity;
import org.eclipse.osbp.dsl.semantic.entity.OSBPEntityPackage;
import org.eclipse.osbp.xtext.oxtype.imports.DefaultShouldImportProvider;
public class ShouldImportProvider extends DefaultShouldImportProvider {
protected boolean doShouldImport(EObject toImport, EReference eRef,
EObject context) {
return toImport instanceof LEntity;
}
protected boolean doShouldProposeAllElements(EObject object, EReference reference) {
EClass type = reference.getEReferenceType();
return OSBPEntityPackage.Literals.LENTITY.isSuperTypeOf(type);
}
}