blob: cc94b4a3e288307dc93ba08cf8f972d1d02f2e93 [file] [log] [blame]
package org.eclipse.osbp.xtext.action.imports;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.osbp.xtext.datainterchange.DataDSLPackage;
import org.eclipse.osbp.xtext.datainterchange.DataInterchange;
import org.eclipse.osbp.xtext.functionlibrarydsl.FunctionLibraryActionGroup;
import org.eclipse.osbp.xtext.functionlibrarydsl.FunctionLibraryCanExecute;
import org.eclipse.osbp.xtext.functionlibrarydsl.FunctionLibraryDSLPackage;
import org.eclipse.osbp.xtext.functionlibrarydsl.FunctionLibraryExecute;
import org.eclipse.osbp.xtext.messagedsl.MessageCategory;
import org.eclipse.osbp.xtext.messagedsl.MessageDSLPackage;
import org.eclipse.osbp.xtext.messagedsl.MessageItem;
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 FunctionLibraryActionGroup ||
toImport instanceof FunctionLibraryCanExecute ||
toImport instanceof FunctionLibraryExecute ||
toImport instanceof DataInterchange ||
toImport instanceof MessageCategory ||
toImport instanceof MessageItem;
}
protected boolean doShouldProposeAllElements(EObject object, EReference reference) {
EClass type = reference.getEReferenceType();
return FunctionLibraryDSLPackage.Literals.FUNCTION_LIBRARY_ACTION_GROUP.isSuperTypeOf(type)
|| FunctionLibraryDSLPackage.Literals.FUNCTION_LIBRARY_CAN_EXECUTE.isSuperTypeOf(type)
|| FunctionLibraryDSLPackage.Literals.FUNCTION_LIBRARY_EXECUTE.isSuperTypeOf(type)
|| DataDSLPackage.Literals.DATA_INTERCHANGE.isSuperTypeOf(type)
|| MessageDSLPackage.Literals.MESSAGE_CATEGORY.isSuperTypeOf(type)
|| MessageDSLPackage.Literals.MESSAGE_ITEM.isSuperTypeOf(type);
}
}