| /** |
| * 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.table.jvmmodel; |
| |
| import com.vaadin.data.Container; |
| import com.vaadin.data.Property; |
| import com.vaadin.server.Page; |
| import com.vaadin.shared.ui.label.ContentMode; |
| import com.vaadin.ui.Button; |
| import com.vaadin.ui.CustomTable; |
| import com.vaadin.ui.HorizontalLayout; |
| import com.vaadin.ui.Label; |
| import com.vaadin.ui.Notification; |
| import com.vaadin.ui.TabSheet; |
| import com.vaadin.ui.UI; |
| import java.util.ArrayList; |
| import java.util.Collection; |
| import java.util.Date; |
| import java.util.HashMap; |
| import java.util.Iterator; |
| import java.util.List; |
| import java.util.Locale; |
| import java.util.Map; |
| import java.util.Set; |
| import java.util.TreeSet; |
| import java.util.UUID; |
| import java.util.concurrent.Executors; |
| import java.util.concurrent.TimeUnit; |
| import javax.inject.Inject; |
| import org.drools.SystemEventListenerFactory; |
| import org.drools.event.process.ProcessCompletedEvent; |
| import org.eclipse.bpmn2.Task; |
| import org.eclipse.e4.core.contexts.ContextInjectionFactory; |
| import org.eclipse.e4.core.di.extensions.EventUtils; |
| import org.eclipse.e4.core.services.events.IEventBroker; |
| import org.eclipse.e4.ui.model.application.MApplication; |
| import org.eclipse.emf.ecore.EObject; |
| import org.eclipse.emf.ecore.resource.Resource; |
| import org.eclipse.osbp.bpm.api.AbstractBlipBPMFunctionProvider; |
| import org.eclipse.osbp.bpm.api.IBlipBPMConstants; |
| import org.eclipse.osbp.bpm.api.IBlipBPMStartInfo; |
| import org.eclipse.osbp.bpm.api.IBlipBPMWorkloadModifiableItem; |
| import org.eclipse.osbp.dsl.common.datatypes.IDto; |
| import org.eclipse.osbp.dsl.dto.lib.impl.DtoServiceAccess; |
| import org.eclipse.osbp.dsl.dto.lib.services.IDTOServiceWithMutablePersistence; |
| import org.eclipse.osbp.eventbroker.EventBrokerMsg; |
| import org.eclipse.osbp.preferences.ProductConfiguration; |
| import org.eclipse.osbp.ui.api.contextfunction.IViewEmbeddedProvider; |
| import org.eclipse.osbp.ui.api.datamart.DerivedOlapException; |
| import org.eclipse.osbp.ui.api.themes.IThemeResourceService; |
| import org.eclipse.osbp.utils.constants.ExtendedDate; |
| import org.eclipse.osbp.utils.vaadin.SelectUserWindow; |
| import org.eclipse.osbp.utils.vaadin.ViewLayoutManager; |
| import org.eclipse.osbp.xtext.basic.generator.BasicDslGeneratorUtils; |
| import org.eclipse.osbp.xtext.blip.BlipItem; |
| import org.eclipse.osbp.xtext.datamart.common.AEntityDatamart; |
| import org.eclipse.osbp.xtext.datamart.common.DatamartFilterGenerator; |
| import org.eclipse.osbp.xtext.datamart.common.olap.DerivedAxis; |
| import org.eclipse.osbp.xtext.datamart.common.olap.DerivedHierarchy; |
| import org.eclipse.osbp.xtext.datamart.common.olap.DerivedLevel; |
| import org.eclipse.osbp.xtext.datamart.common.olap.DerivedMember; |
| import org.eclipse.osbp.xtext.datamart.common.olap.DerivedPosition; |
| import org.eclipse.osbp.xtext.datamart.common.sql.OperativeDtoContainer; |
| import org.eclipse.osbp.xtext.i18n.I18NModelGenerator; |
| import org.eclipse.osbp.xtext.table.common.CellSetFilterTable; |
| import org.eclipse.osbp.xtext.table.common.CellSetIndexedContainer; |
| import org.eclipse.osbp.xtext.table.common.CellSetPagedFilterTable; |
| import org.eclipse.osbp.xtext.table.common.CheckboxSelectionCellSetFilterTable; |
| import org.eclipse.osbp.xtext.table.common.TableFilterDecorator; |
| import org.eclipse.osbp.xtext.table.common.TableFilterGenerator; |
| import org.eclipse.osbp.xtext.table.generator.TableGridSourceGenerator; |
| 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.Exceptions; |
| import org.eclipse.xtext.xbase.lib.Extension; |
| import org.jbpm.task.Status; |
| import org.jbpm.task.event.TaskEventListener; |
| import org.jbpm.task.event.entity.TaskUserEvent; |
| import org.jbpm.task.query.TaskSummary; |
| import org.jbpm.task.service.Operation; |
| import org.jbpm.task.service.PermissionDeniedException; |
| import org.jbpm.task.service.mina.MinaTaskClientConnector; |
| import org.jbpm.task.service.mina.MinaTaskClientHandler; |
| import org.osgi.service.event.Event; |
| import org.osgi.service.event.EventHandler; |
| import org.vaadin.hene.popupbutton.PopupButton; |
| |
| @SuppressWarnings("all") |
| public class TableModelGenerator extends I18NModelGenerator { |
| @Inject |
| private TableGridSourceGenerator delegate; |
| |
| @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, Property.ValueChangeListener.class, Label.class, List.class, Set.class, TreeSet.class, Iterator.class, ArrayList.class, Page.class, Page.Styles.class, DerivedAxis.class, DerivedPosition.class, DerivedMember.class, HorizontalLayout.class, TabSheet.class, Notification.class, Button.ClickEvent.class, Button.class, Notification.Type.class, CustomTable.Align.class, OperativeDtoContainer.class, DerivedHierarchy.class, DerivedLevel.class, DerivedOlapException.class, IEventBroker.class, PopupButton.class, CellSetFilterTable.class, CellSetPagedFilterTable.class, CheckboxSelectionCellSetFilterTable.class, CustomTable.class, CustomTable.RowHeaderMode.class, Container.class, CellSetIndexedContainer.class, TableFilterDecorator.class, TableFilterGenerator.class, Date.class, ExtendedDate.class, TimeUnit.class, EventHandler.class, Event.class, EventUtils.class, ContentMode.class, EventBrokerMsg.class, Status.class, Operation.class, Executors.class, TaskSummary.class, TaskEventListener.class, TaskUserEvent.class, ProcessCompletedEvent.class, PermissionDeniedException.class, SelectUserWindow.class, MinaTaskClientConnector.class, MinaTaskClientHandler.class, SystemEventListenerFactory.class, UUID.class, ProductConfiguration.class, AEntityDatamart.class, IViewEmbeddedProvider.class, MApplication.class, ContextInjectionFactory.class, UI.class, Locale.class, IThemeResourceService.class, IThemeResourceService.ThemeResourceType.class, AbstractBlipBPMFunctionProvider.class, IBlipBPMConstants.class, IBlipBPMStartInfo.class, IBlipBPMWorkloadModifiableItem.class, IDto.class, Task.class, BlipItem.class, IDTOServiceWithMutablePersistence.class, DtoServiceAccess.class, DatamartFilterGenerator.class, ViewLayoutManager.class); |
| _xblockexpression = super.createAppendable(context, importManager, config); |
| } |
| return _xblockexpression; |
| } |
| |
| public void doGenerate(final Resource resource, final IFileSystemAccess fsa) { |
| super.addTranslatables("save,cancel,securityMessage,Page,Items per page,showAll,endDate,startDate,setFilter,clearFilter,lesser_than,greater_than,equal_to,ok,reset,[x]"); |
| try { |
| super.doGenerate(resource, fsa); |
| } catch (final Throwable _t) { |
| if (_t instanceof Throwable) { |
| final Throwable e = (Throwable)_t; |
| System.err.println(e); |
| } else { |
| throw Exceptions.sneakyThrow(_t); |
| } |
| } |
| this.delegate.doGenerate(resource, fsa); |
| } |
| } |