| package org.eclipse.osbp.xtext.oxtype.imports; |
| |
| import org.eclipse.emf.ecore.EObject; |
| import org.eclipse.emf.ecore.EReference; |
| |
| import com.google.inject.ImplementedBy; |
| |
| /** |
| * Every grammar using the {@link EObjectUsageCollector} need to provide an |
| * implementation. |
| */ |
| @ImplementedBy(DefaultShouldImportProvider.class) |
| public interface IShouldImportProvider { |
| |
| /** |
| * Returns true, if the given eObject should be imported. |
| * |
| * @param toImport |
| * - the EObject that may be imported |
| * @param eRef |
| * - the {@link EReference} |
| * @param contextthe |
| * root EObject of the resource |
| * @return |
| */ |
| boolean shouldImport(EObject toImport, EReference eRef, EObject context); |
| |
| /** |
| * Returns true, if for the given parameters, the content assist should show |
| * all available elements. |
| * |
| * @param context |
| * @param reference |
| * @return |
| */ |
| boolean shouldProposeAllElements(EObject context, EReference reference); |
| |
| /** |
| * Returns true, if for the given parameters, the selected proposal should be automatically imported. |
| * |
| * @param context |
| * @param reference |
| * @return |
| */ |
| boolean shouldAutoImport(EObject context, EReference reference); |
| |
| } |