2 * Copyright (c) 2017 ZTE Corporation.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * and the Apache License 2.0 which both accompany this distribution,
6 * and are available at http://www.eclipse.org/legal/epl-v10.html
7 * and http://www.apache.org/licenses/LICENSE-2.0
10 * ZTE - initial API and implementation and/or initial documentation
13 import { AfterViewInit, Component } from '@angular/core';
15 import { WorkflowNode } from '../../model/workflow-node';
16 import { BroadcastService } from '../../services/broadcast.service';
17 import { JsPlumbService } from '../../services/jsplumb.service';
18 import { WorkflowService } from '../../services/workflow.service';
21 * property component presents information of a workflow node.
22 * the presented information can be edit in this component.
23 * it may load information dynamically. the content may be different for different node type.
26 selector: 'b4t-properties',
27 styleUrls: ['./properties.component.css'],
28 templateUrl: 'properties.component.html',
30 export class PropertiesComponent implements AfterViewInit {
31 public node: WorkflowNode;
33 public titleEditing = false;
35 constructor(private broadcastService: BroadcastService,
36 private jsPlumnService: JsPlumbService,
37 private workflowService: WorkflowService) {
41 public ngAfterViewInit() {
42 this.broadcastService.showProperty$.subscribe(show => this.show = show);
43 this.broadcastService.nodeProperty$.subscribe(node => this.node = node);
46 public nodeNameChanged() {
47 this.titleEditing = !this.titleEditing;
48 this.jsPlumnService.jsplumbInstance.repaintEverything();
54 this.jsPlumnService.remove(this.node.id);
55 this.workflowService.deleteNode(this.node.id);