| package org.eclipse.osbp.xtext.chart.imports; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.EObject; |
| import org.eclipse.emf.ecore.EReference; |
| import org.eclipse.osbp.xtext.datamartdsl.DatamartDSLPackage; |
| import org.eclipse.osbp.xtext.datamartdsl.DatamartDefinition; |
| 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 DatamartDefinition; |
| } |
| |
| protected boolean doShouldProposeAllElements(EObject object, EReference reference) { |
| EClass type = reference.getEReferenceType(); |
| return DatamartDSLPackage.Literals.DATAMART_DEFINITION.isSuperTypeOf(type); |
| } |
| } |