| /** |
| * |
| * Copyright (c) 2011, 2016 - 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: |
| * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation |
| * |
| * |
| * This copyright notice shows up in the generated Java code |
| * |
| */ |
| |
| package org.eclipse.osbp.xtext.i18n |
| |
| import com.google.inject.Inject |
| import org.eclipse.emf.ecore.EObject |
| import org.eclipse.xtext.common.types.JvmDeclaredType |
| import org.eclipse.xtext.naming.IQualifiedNameProvider |
| import org.eclipse.xtext.xbase.jvmmodel.IJvmDeclaredTypeAcceptor |
| import org.eclipse.xtext.xbase.jvmmodel.JvmAnnotationReferenceBuilder |
| import org.eclipse.xtext.xbase.jvmmodel.JvmTypeReferenceBuilder |
| import org.eclipse.osbp.dsl.semantic.common.types.LTypedPackage |
| import org.eclipse.osbp.dsl.xtext.lazyresolver.api.hook.IInferrerDelegate |
| |
| @SuppressWarnings("restriction") |
| class JvmInferrerDelegate implements IInferrerDelegate { |
| |
| // @Inject IndexDerivedStateHelper stateHelper |
| // @Inject extension I18NModelTranslatables |
| @Inject extension IQualifiedNameProvider |
| @Inject JvmAnnotationReferenceBuilder.Factory annotationRefBuilderFactory; |
| @Inject JvmTypeReferenceBuilder.Factory typeRefBuilderFactory; |
| |
| @Extension protected JvmAnnotationReferenceBuilder _annotationTypesBuilder; |
| @Extension protected JvmTypeReferenceBuilder _typeReferenceBuilder; |
| |
| override void inferTypesOnly(EObject semanticElement, IJvmDeclaredTypeAcceptor acceptor, boolean preIndexingPhase) { |
| if (semanticElement instanceof LTypedPackage) { |
| val LTypedPackage lPkg = semanticElement as LTypedPackage; |
| // inferTranslatorTypeOnly(lPkg.fullyQualifiedName, lPkg, acceptor, I18nUtil.TRANSLATABLE) |
| } |
| } |
| |
| override void inferFullState(JvmDeclaredType jvmType, EObject semanticElement, IJvmDeclaredTypeAcceptor acceptor, |
| boolean preIndexingPhase, String selector) { |
| if (_annotationTypesBuilder==null){ |
| _annotationTypesBuilder = annotationRefBuilderFactory.create(semanticElement.eResource.getResourceSet()); |
| } |
| if (_typeReferenceBuilder==null){ |
| _typeReferenceBuilder = typeRefBuilderFactory.create(semanticElement.eResource.getResourceSet()); |
| } |
| if (selector != null && selector.equals("osbp.translator")) { |
| // additionalTranslatables("Name,Priority,Status,Subject,Description,ExpirationTime,CreatedOn,CreatedBy,ActivationTime,ActualOwner,TaskId,ProcessId,ProcessInstanceId,ProcessSessionId") |
| val LTypedPackage lPkg = semanticElement as LTypedPackage; |
| // infeTranslatorFullState(lPkg.fullyQualifiedName, jvmType, lPkg, _typeReferenceBuilder, _annotationTypesBuilder, acceptor, I18nUtil.TRANSLATABLE) |
| } |
| } |
| } |