support set parameter for workflow
[sdc/sdc-workflow-designer.git] / sdc-workflow-designer-ui / src / app / components / node / node.component.ts
1 /**\r
2  * Copyright (c) 2017 ZTE Corporation.\r
3  * All rights reserved. This program and the accompanying materials\r
4  * are made available under the terms of the Eclipse Public License v1.0\r
5  * and the Apache License 2.0 which both accompany this distribution,\r
6  * and are available at http://www.eclipse.org/legal/epl-v10.html\r
7  * and http://www.apache.org/licenses/LICENSE-2.0\r
8  *\r
9  * Contributors:\r
10  *     ZTE - initial API and implementation and/or initial documentation\r
11  */\r
12 \r
13 import { Component, AfterViewInit, Input } from '@angular/core';\r
14 \r
15 import { JsPlumbService } from '../../services/jsplumb.service';\r
16 import { BroadcastService } from "../../services/broadcast.service";\r
17 import { WorkflowNode } from "../../model/workflow/workflow-node";\r
18 \r
19 /**\r
20  * workflow node component\r
21  */\r
22 @Component({\r
23     selector: 'b4t-node',\r
24     styleUrls: ['./node.component.css'],\r
25     templateUrl: 'node.component.html',\r
26 })\r
27 export class NodeComponent implements AfterViewInit {\r
28 \r
29     @Input() public node: WorkflowNode;\r
30     @Input() public last: boolean;\r
31 \r
32     constructor(private broadcastService: BroadcastService,\r
33         private jsPlumbService: JsPlumbService) {\r
34 \r
35     }\r
36 \r
37     ngAfterViewInit(): void {\r
38         if(this.last) {\r
39             this.jsPlumbService.initNode('.node');\r
40         }\r
41     }\r
42 \r
43     public showProperties() {\r
44         this.broadcastService.broadcast(this.broadcastService.nodeProperty, this.node);\r
45         this.broadcastService.broadcast(this.broadcastService.showProperty, true);\r
46     }\r
47 \r
48 }\r