| /** |
| * 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.perspective.jvmmodel; |
| |
| import com.vaadin.ui.UI; |
| import java.util.ArrayList; |
| import java.util.Collection; |
| import java.util.HashMap; |
| import java.util.Locale; |
| import java.util.Map; |
| import java.util.ResourceBundle; |
| import javax.inject.Inject; |
| import org.eclipse.core.databinding.DataBindingContext; |
| import org.eclipse.core.databinding.UpdateValueStrategy; |
| import org.eclipse.core.databinding.beans.BeansObservables; |
| import org.eclipse.e4.core.di.extensions.EventUtils; |
| import org.eclipse.e4.core.services.events.IEventBroker; |
| import org.eclipse.emf.ecore.EObject; |
| import org.eclipse.emf.ecore.resource.Resource; |
| import org.eclipse.osbp.eventbroker.EventBrokerMsg; |
| import org.eclipse.osbp.runtime.common.i18n.ITranslator; |
| import org.eclipse.osbp.runtime.web.vaadin.databinding.VaadinObservables; |
| import org.eclipse.osbp.xtext.basic.generator.BasicDslGeneratorUtils; |
| import org.eclipse.osbp.xtext.i18n.I18NModelGenerator; |
| import org.eclipse.xtext.common.types.JvmType; |
| import org.eclipse.xtext.common.types.JvmTypeReference; |
| import org.eclipse.xtext.generator.IFileSystemAccess; |
| import org.eclipse.xtext.xbase.compiler.GeneratorConfig; |
| import org.eclipse.xtext.xbase.compiler.ImportManager; |
| import org.eclipse.xtext.xbase.compiler.output.TreeAppendable; |
| import org.eclipse.xtext.xbase.lib.Extension; |
| import org.osgi.service.event.EventHandler; |
| import org.slf4j.Logger; |
| import org.slf4j.LoggerFactory; |
| |
| @SuppressWarnings("all") |
| public class PerspectiveModelGenerator extends I18NModelGenerator { |
| @Inject |
| @Extension |
| private BasicDslGeneratorUtils _basicDslGeneratorUtils; |
| |
| public TreeAppendable createAppendable(final EObject context, final ImportManager importManager, final GeneratorConfig config) { |
| TreeAppendable _xblockexpression = null; |
| { |
| Resource _eResource = context.eResource(); |
| this.setBuilder(_eResource); |
| JvmTypeReference _typeRef = this._typeReferenceBuilder.typeRef(String.class); |
| JvmTypeReference _typeRef_1 = this._typeReferenceBuilder.typeRef(String.class); |
| JvmTypeReference _typeRef_2 = this._typeReferenceBuilder.typeRef(HashMap.class, _typeRef, _typeRef_1); |
| JvmType _type = _typeRef_2.getType(); |
| importManager.addImportFor(_type); |
| JvmTypeReference _typeRef_3 = this._typeReferenceBuilder.typeRef(String.class); |
| JvmTypeReference _typeRef_4 = this._typeReferenceBuilder.typeRef(String.class); |
| JvmTypeReference _typeRef_5 = this._typeReferenceBuilder.typeRef(Map.class, _typeRef_3, _typeRef_4); |
| JvmType _type_1 = _typeRef_5.getType(); |
| importManager.addImportFor(_type_1); |
| JvmTypeReference _typeRef_6 = this._typeReferenceBuilder.typeRef(String.class); |
| JvmTypeReference _typeRef_7 = this._typeReferenceBuilder.typeRef(Collection.class, _typeRef_6); |
| JvmType _type_2 = _typeRef_7.getType(); |
| importManager.addImportFor(_type_2); |
| this._basicDslGeneratorUtils.addImportFor(this, importManager, this._typeReferenceBuilder, ArrayList.class, IEventBroker.class, EventUtils.class, EventBrokerMsg.class, EventHandler.class, Logger.class, LoggerFactory.class, UI.class, VaadinObservables.class, DataBindingContext.class, BeansObservables.class, ResourceBundle.class, Locale.class, UpdateValueStrategy.class, ITranslator.class); |
| _xblockexpression = super.createAppendable(context, importManager, config); |
| } |
| return _xblockexpression; |
| } |
| |
| public void doGenerate(final Resource resource, final IFileSystemAccess fsa) { |
| this.addTranslatables("PerspectiveNA"); |
| super.doGenerate(resource, fsa); |
| } |
| } |