blob: fd4510cae9d7cd9ff5b73bf481a086a71319fe53 [file] [log] [blame]
package org.eclipse.osbp.ecview.dsl.imports;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.osbp.xtext.oxtype.imports.DefaultShouldImportProvider;
import org.eclipse.xtext.common.types.JvmType;
public class ShouldImportProvider extends DefaultShouldImportProvider {
@Override
public boolean shouldImport(EObject toImport, EReference eRef,
EObject context) {
// in this case, we also need to import JvmTypes
// The JvmTypeOrganizeImport stuff will not do so, since
// UiBeanSlot#jvmType has no parent context based on JvmType hence no
// inferrer
if (toImport instanceof JvmType) {
return true;
}
boolean result = toImport.eResource() != context.eResource();
if (result == true) {
return doShouldImport(toImport, eRef, context);
} else {
return false;
}
}
protected boolean doShouldImport(EObject toImport, EReference eRef,
EObject context) {
return false;
}
}