| /** |
| * |
| * 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 2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Contributors: |
| * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation |
| * |
| */ |
| package org.eclipse.osbp.utils.vaadin.bpmn; |
| |
| import javax.annotation.PostConstruct; |
| import javax.inject.Inject; |
| import javax.inject.Named; |
| |
| import org.eclipse.e4.core.contexts.IEclipseContext; |
| import org.eclipse.e4.core.di.annotations.Optional; |
| import org.eclipse.e4.ui.model.application.MApplication; |
| import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
| import org.eclipse.e4.ui.model.application.ui.impl.UIElementImpl; |
| import org.eclipse.e4.ui.model.application.ui.impl.UiPackageImpl; |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.common.notify.impl.AdapterImpl; |
| import org.eclipse.emf.ecore.EObject; |
| import org.eclipse.osbp.bpm.api.IBPMEngine; |
| import org.eclipse.osbp.bpm.api.IBlipBPMFunctionProvider; |
| import org.slf4j.Logger; |
| |
| import com.vaadin.server.Page; |
| import com.vaadin.server.Page.BrowserWindowResizeEvent; |
| import com.vaadin.server.Page.BrowserWindowResizeListener; |
| import com.vaadin.ui.HorizontalLayout; |
| import com.vaadin.ui.UI; |
| import com.vaadin.ui.VerticalLayout; |
| |
| @SuppressWarnings("all") |
| public class BpmnView { |
| private static Logger log = org.slf4j.LoggerFactory |
| .getLogger(BpmnView.class); |
| |
| private HorizontalLayout lowerArea; |
| |
| @Inject |
| @Optional |
| private IBPMEngine bpmEngine; |
| |
| @Inject |
| @Named("Blip") |
| private IBlipBPMFunctionProvider blip; |
| |
| private VerticalLayout workArea; |
| |
| private BpmnRenderer bpmnRenderer; |
| |
| private String processId; |
| |
| private VerticalLayout parent; |
| |
| private IEclipseContext eclipseContext; |
| |
| @Inject |
| public BpmnView(final VerticalLayout parent, final IEclipseContext context, |
| final MApplication app) { |
| this.parent = parent; |
| this.eclipseContext = context; |
| } |
| |
| @PostConstruct |
| public void createView(final VerticalLayout parent) { |
| parent.setPrimaryStyleName("osbp"); |
| bpmnRenderer = new BpmnRenderer(bpmEngine, blip, eclipseContext); |
| |
| VerticalLayout inner = new VerticalLayout(); |
| inner.setMargin(false); |
| inner.setSizeFull(); |
| inner.setPrimaryStyleName("osbp"); |
| inner.addComponent(bpmnRenderer); |
| parent.addComponent(inner); |
| } |
| |
| public void selectTask(String taskName) { |
| bpmnRenderer.setSelectedCell(taskName); |
| } |
| } |