blob: 1da39c770af6a217d8baed7c1a6a2f6a2cbf0188 [file] [log] [blame]
/**
* Copyright (c) 2011, 2015 - Lunifera GmbH (Gross Enzersdorf, Austria), 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:
* Florian Pirchner - Initial implementation
*
*/
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);
}