| package org.eclipse.osbp.xtext.menu.imports; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.EObject; |
| import org.eclipse.emf.ecore.EReference; |
| import org.eclipse.osbp.xtext.blip.Blip; |
| import org.eclipse.osbp.xtext.blip.BlipDSLPackage; |
| import org.eclipse.osbp.xtext.dialogdsl.Dialog; |
| import org.eclipse.osbp.xtext.dialogdsl.DialogDSLPackage; |
| import org.eclipse.osbp.xtext.oxtype.imports.DefaultShouldImportProvider; |
| import org.eclipse.osbp.xtext.perspective.Perspective; |
| import org.eclipse.osbp.xtext.perspective.PerspectiveDslPackage; |
| import org.eclipse.osbp.xtext.table.Table; |
| import org.eclipse.osbp.xtext.table.TableDSLPackage; |
| |
| public class ShouldImportProvider extends DefaultShouldImportProvider { |
| |
| protected boolean doShouldImport(EObject toImport, EReference eRef, EObject context) { |
| return toImport instanceof Blip || toImport instanceof Perspective || toImport instanceof Table |
| || toImport instanceof Dialog; |
| } |
| |
| protected boolean doShouldProposeAllElements(EObject object, EReference reference) { |
| EClass type = reference.getEReferenceType(); |
| return BlipDSLPackage.Literals.BLIP.isSuperTypeOf(type) |
| || PerspectiveDslPackage.Literals.PERSPECTIVE.isSuperTypeOf(type) |
| || TableDSLPackage.Literals.TABLE.isSuperTypeOf(type) |
| || DialogDSLPackage.Literals.DIALOG.isSuperTypeOf(type); |
| } |
| } |