blob: 54defed3cd2f762497caab16b79fa8b3b48b9954 [file] [log] [blame]
/**
* Copyright (c) 2011, 2018 - 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.signal.jvmmodel;
import com.vaadin.ui.Notification;
import java.io.File;
import java.io.FileInputStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.nio.file.FileSystems;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardWatchEventKinds;
import java.nio.file.WatchEvent;
import java.nio.file.WatchKey;
import java.util.HashMap;
import java.util.Properties;
import javax.inject.Inject;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.osbp.core.api.persistence.IPersistenceService;
import org.eclipse.osbp.datainterchange.api.IDataInterchange;
import org.eclipse.osbp.preferences.ProductConfiguration;
import org.eclipse.osbp.runtime.common.event.EventDispatcherEvent;
import org.eclipse.osbp.xtext.basic.generator.BasicDslGeneratorUtils;
import org.eclipse.osbp.xtext.datainterchange.common.WorkerThreadRunnable;
import org.eclipse.osbp.xtext.i18n.I18NModelGenerator;
import org.eclipse.osbp.xtext.signal.SignalActionEnum;
import org.eclipse.osbp.xtext.signal.SignalTypeEnum;
import org.eclipse.osbp.xtext.signal.common.OSBPSignalWatcher;
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.slf4j.LoggerFactory;
@SuppressWarnings("all")
public class SignalModelGenerator extends I18NModelGenerator {
@Inject
@Extension
private BasicDslGeneratorUtils _basicDslGeneratorUtils;
public static String pckgName = null;
@Override
public TreeAppendable createAppendable(final EObject context, final ImportManager importManager, final GeneratorConfig config) {
TreeAppendable _xblockexpression = null;
{
this.setBuilder(context.eResource());
this._basicDslGeneratorUtils.addImportFor(this, importManager, this._typeReferenceBuilder,
SignalTypeEnum.class,
LoggerFactory.class,
OSBPSignalWatcher.class,
StandardWatchEventKinds.class,
WatchKey.class,
WatchEvent.class,
WatchEvent.Kind.class,
Path.class,
Paths.class,
ProductConfiguration.class,
File.class,
FileInputStream.class,
StringWriter.class,
PrintWriter.class,
Properties.class,
Notification.class,
WorkerThreadRunnable.class,
EventDispatcherEvent.EventDispatcherCommand.class,
EventDispatcherEvent.EventDispatcherDataTag.class,
EventDispatcherEvent.class,
IPersistenceService.class,
IDataInterchange.class,
SignalActionEnum.class,
FileSystems.class,
HashMap.class);
_xblockexpression = super.createAppendable(context, importManager, config);
}
return _xblockexpression;
}
@Override
public void doGenerate(final Resource resource, final IFileSystemAccess fsa) {
super.doGenerate(resource, fsa);
}
}