| /** |
| * 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 v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * Florian Pirchner - Initial implementation |
| */ |
| package org.eclipse.osbp.dsl.services.xtext.scope; |
| |
| import org.eclipse.emf.ecore.EObject; |
| import org.eclipse.emf.ecore.EReference; |
| import org.eclipse.xtext.scoping.IScope; |
| import org.eclipse.osbp.dsl.common.xtext.scope.CommonBatchScopeProvider; |
| import org.eclipse.osbp.dsl.semantic.service.LFilterableAttributes; |
| import org.eclipse.osbp.dsl.semantic.service.LSortableAttributes; |
| import org.eclipse.osbp.dsl.semantic.service.OSBPServicePackage; |
| |
| /** |
| * This class contains custom scoping description. |
| * |
| * see : http://www.eclipse.org/Xtext/documentation/latest/xtext.html#scoping on |
| * how and when to use it |
| * |
| */ |
| @SuppressWarnings("restriction") |
| public class ServicesBatchScopeProvider extends CommonBatchScopeProvider { |
| |
| @Override |
| public IScope getScope(final EObject context, EReference reference) { |
| if (reference == OSBPServicePackage.Literals.LFILTERABLE_ATTRIBUTES__FILTERABLE_FEATURES) { |
| return new ServicesFilterableScope((LFilterableAttributes) context); |
| } else if (reference == OSBPServicePackage.Literals.LSORTABLE_ATTRIBUTES__SORTABLE_FEATURES) { |
| return new ServicesSortableScope((LSortableAttributes) context); |
| } |
| |
| // if (reference == OSBPServicePackage.Literals.LSER) { |
| // return new ServicesInheritedReferenceScope( |
| // (LDtoInheritedReference) context); |
| // } else if (reference == |
| // OSBPServicePackage.Literals.LDTO_INHERITED_ATTRIBUTE__INHERITED_FEATURE) |
| // { |
| // return new ServicesInheritedAttributeScope( |
| // (LDtoInheritedAttribute) context); |
| // } else if (reference == OSBPServicePackage.Literals.LDTO__SUPER_TYPE) |
| // { |
| // return new InheritTypesFilterScope((LType) context, super.getScope( |
| // context, reference)); |
| // } |
| return super.getScope(context, reference); |
| } |
| |
| } |