Skip to content

Commit 3b95fba

Browse files
committed
Rename IotLaunch* => Launch*Node
1 parent d8d2b0f commit 3b95fba

12 files changed

+66
-66
lines changed

src/IotItemTree.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import {IotDevice} from './IotDevice';
66
import {IotDeviceAccount} from './IotDeviceAccount';
77
import {IotDeviceInformation} from './IotDeviceInformation';
88
import {IotDevicePackage} from './IotDevicePackage';
9-
import {IotLaunch} from './IotLaunch';
10-
import {IotLaunchOptions} from './IotLaunchOptions';
9+
import {LaunchNode} from './LaunchNode';
10+
import {LaunchOptionsNode} from './LaunchOptionsNode';
1111

1212
export class IotItemTree extends BaseTreeItem {
1313
public Parent: IotDevice| IotDeviceAccount| IotDeviceInformation| IotItemTree|
14-
IotDevicePackage| IotLaunch| IotLaunchOptions;
14+
IotDevicePackage| LaunchNode| LaunchOptionsNode;
1515
public Childs: Array<IotItemTree>=[];
1616
public Device: IotDevice;
1717

@@ -21,7 +21,7 @@ export class IotItemTree extends BaseTreeItem {
2121
tooltip: string | vscode.MarkdownString | undefined,
2222
collapsibleState: vscode.TreeItemCollapsibleState,
2323
parent: IotDevice| IotDeviceAccount| IotDeviceInformation| IotItemTree|
24-
IotDevicePackage| IotLaunch| IotLaunchOptions,
24+
IotDevicePackage| LaunchNode| LaunchOptionsNode,
2525
device: IotDevice
2626
){
2727
super(label,description,tooltip,collapsibleState);
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,25 @@ import * as path from 'path';
44
import {BaseTreeItem} from './BaseTreeItem';
55
import {IotDevice} from './IotDevice';
66
import {StatusResult,IotResult} from './IotResult';
7-
import {IotLaunch} from './IotLaunch';
7+
import {LaunchNode} from './LaunchNode';
88

9-
export class IotLaunchEnvironment extends BaseTreeItem{
9+
export class LaunchEnvironmentNode extends BaseTreeItem{
1010

11-
public Parent: IotLaunch|IotLaunchEnvironment;
12-
public Childs: Array<IotLaunchEnvironment>=[];
11+
public Parent: LaunchNode|LaunchEnvironmentNode;
12+
public Childs: Array<LaunchEnvironmentNode>=[];
1313
public Device: IotDevice| undefined;
1414

1515
public Items:Map<string, string>=new Map<string, string>();
1616

17-
public Launch: IotLaunch;
17+
public Launch: LaunchNode;
1818

1919
constructor(
2020
label: string,
2121
description: string| undefined,
2222
tooltip: string | vscode.MarkdownString | undefined,
2323
collapsibleState: vscode.TreeItemCollapsibleState,
24-
parent: IotLaunch|IotLaunchEnvironment,
25-
launch: IotLaunch
24+
parent: LaunchNode|LaunchEnvironmentNode,
25+
launch: LaunchNode
2626
){
2727
super(label,description,tooltip,collapsibleState);
2828
this.Parent=parent;
@@ -87,10 +87,10 @@ export class IotLaunchEnvironment extends BaseTreeItem{
8787
private CreateChildElements(){
8888
//create child elements
8989
this.Childs=[];
90-
let element:IotLaunchEnvironment;
90+
let element:LaunchEnvironmentNode;
9191
//
9292
this.Items.forEach((value,key) => {
93-
element = new IotLaunchEnvironment(key,value,value,vscode.TreeItemCollapsibleState.None,
93+
element = new LaunchEnvironmentNode(key,value,value,vscode.TreeItemCollapsibleState.None,
9494
this,this.Launch);
9595
element.iconPath = undefined;
9696
element.contextValue="iotenviromentitem";

src/IotLaunch.ts renamed to src/LaunchNode.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@ import * as path from 'path';
44
import {BaseTreeItem} from './BaseTreeItem';
55
import {IotResult,StatusResult } from './IotResult';
66
import {IotDevice} from './IotDevice';
7-
import {IotLaunchOptions} from './IotLaunchOptions';
8-
import {IotLaunchEnvironment} from './IotLaunchEnvironment';
7+
import {LaunchOptionsNode} from './LaunchOptionsNode';
8+
import {LaunchEnvironmentNode} from './LaunchEnvironmentNode';
99
import {IoTHelper} from './Helper/IoTHelper';
1010
import {launchHelper} from './Helper/launchHelper';
1111

12-
export class IotLaunch extends BaseTreeItem {
12+
export class LaunchNode extends BaseTreeItem {
1313
public Parent: undefined;
14-
public Childs: Array<IotLaunchOptions| IotLaunchEnvironment>=[];
14+
public Childs: Array<LaunchOptionsNode| LaunchEnvironmentNode>=[];
1515
public Device: IotDevice| undefined;
1616

1717
public IdLaunch:string="";
1818
public PathProject:string="";
1919
public IdTemplate:string="";
2020

21-
public Options: IotLaunchOptions;
22-
public Environments: IotLaunchEnvironment;
21+
public Options: LaunchOptionsNode;
22+
public Environments: LaunchEnvironmentNode;
2323
public WorkspaceDirectory:string;
2424

2525
public readonly LaunchFilePath:string;
@@ -35,9 +35,9 @@ export class IotLaunch extends BaseTreeItem {
3535
//view
3636
this.contextValue="iotlaunch";
3737
//
38-
this.Options = new IotLaunchOptions("Options",undefined,"Options",
38+
this.Options = new LaunchOptionsNode("Options",undefined,"Options",
3939
vscode.TreeItemCollapsibleState.Collapsed,this,this);
40-
this.Environments = new IotLaunchEnvironment("Environments",undefined,"Environments",
40+
this.Environments = new LaunchEnvironmentNode("Environments",undefined,"Environments",
4141
vscode.TreeItemCollapsibleState.Collapsed,this,this);
4242
//view
4343
this.Environments.contextValue="iotenviroments";
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@ import {BaseTreeItem} from './BaseTreeItem';
55
import {IotDevice} from './IotDevice';
66
import {IotItemTree} from './IotItemTree';
77
import {StatusResult,IotResult} from './IotResult';
8-
import {IotLaunch} from './IotLaunch';
8+
import {LaunchNode} from './LaunchNode';
99

10-
export class IotLaunchOptions extends BaseTreeItem{
10+
export class LaunchOptionsNode extends BaseTreeItem{
1111
public Parent: BaseTreeItem| any| undefined;
1212
public Childs: Array<IotItemTree>=[];
1313
public Device: IotDevice| undefined;
14-
private _launch: IotLaunch;
14+
private _launch: LaunchNode;
1515

1616
constructor(
1717
label: string,
1818
description: string| undefined,
1919
tooltip: string | vscode.MarkdownString | undefined,
2020
collapsibleState: vscode.TreeItemCollapsibleState,
21-
parent: IotLaunch| IotLaunchOptions,
22-
launch: IotLaunch
21+
parent: LaunchNode| LaunchOptionsNode,
22+
launch: LaunchNode
2323
){
2424
super(label,description,tooltip,collapsibleState);
2525
this.Parent=parent;

src/TreeDataLaunchsProvider.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ import * as fs from 'fs';
33
import * as path from 'path';
44
import {BaseTreeItem} from './BaseTreeItem';
55
import {IotDevice} from './IotDevice';
6-
import {IotLaunch} from './IotLaunch';
6+
import {LaunchNode} from './LaunchNode';
77
import {IoTHelper} from './Helper/IoTHelper';
88
import {IotResult,StatusResult } from './IotResult';
99
import {IotConfiguration} from './Configuration/IotConfiguration';
1010
import {IotTemplate} from './Templates/IotTemplate';
1111

1212
export class TreeDataLaunchsProvider implements vscode.TreeDataProvider<BaseTreeItem> {
13-
public RootItems:Array<IotLaunch>=[];
13+
public RootItems:Array<LaunchNode>=[];
1414

1515
public Config: IotConfiguration;
1616

@@ -79,7 +79,7 @@ export class TreeDataLaunchsProvider implements vscode.TreeDataProvider<BaseTree
7979
//fromJSON(jsonObj:any,devices: Array<IotDevice>,workspaceDirectory:string):any{
8080
//check folder .vscode with launch.json
8181
//launch.json
82-
const launchBase= new IotLaunch(this._workspaceDirectory);
82+
const launchBase= new LaunchNode(this._workspaceDirectory);
8383
//fromJSON
8484
result = launchBase.GetJsonLaunch();
8585
if(result.Status==StatusResult.Error) return result;
@@ -93,7 +93,7 @@ export class TreeDataLaunchsProvider implements vscode.TreeDataProvider<BaseTree
9393
if(jsonLaunch.fastiotIdLaunch)
9494
{
9595
//parse
96-
let launch = new IotLaunch(this._workspaceDirectory);
96+
let launch = new LaunchNode(this._workspaceDirectory);
9797
result=launch.FromJSON(jsonLaunch,this._devices);
9898
if(result.Status==StatusResult.Ok){
9999
launch.collapsibleState=vscode.TreeItemCollapsibleState.Collapsed;
@@ -115,26 +115,26 @@ export class TreeDataLaunchsProvider implements vscode.TreeDataProvider<BaseTree
115115
return result;
116116
}
117117

118-
public async RenameLaunch(item:IotLaunch,newLabel:string): Promise<IotResult> {
118+
public async RenameLaunch(item:LaunchNode,newLabel:string): Promise<IotResult> {
119119
let result:IotResult;
120120
result=this.GetLaunchbyIdLaunch(item.IdLaunch);
121121
if(result.Status!=StatusResult.Ok) return Promise.resolve(result);
122-
let launch=<IotLaunch>result.returnObject;
122+
let launch=<LaunchNode>result.returnObject;
123123
if(launch){
124124
result=launch.Rename(newLabel);
125125
}else result = new IotResult(StatusResult.Error,`Launch not found IdLaunch:${item.IdLaunch}`);
126126
//result
127127
return Promise.resolve(result);
128128
}
129129

130-
public FindbyIdLaunchInTree(idLaunch:string): IotLaunch|undefined {
130+
public FindbyIdLaunchInTree(idLaunch:string): LaunchNode|undefined {
131131
let launch = this.RootItems.find(x=>x.IdLaunch==idLaunch);
132132
return launch;
133133
}
134134

135135
public GetLaunchbyIdLaunch(idLaunch:string): IotResult {
136136
let result:IotResult;
137-
let launch = new IotLaunch(this._workspaceDirectory);
137+
let launch = new LaunchNode(this._workspaceDirectory);
138138
try {
139139
result=launch.GetJsonLaunch();
140140
if(result.Status==StatusResult.Error) return result;
@@ -160,7 +160,7 @@ export class TreeDataLaunchsProvider implements vscode.TreeDataProvider<BaseTree
160160
let result:IotResult;
161161
result=this.GetLaunchbyIdLaunch(idLaunch);
162162
if(result.Status!=StatusResult.Ok) return Promise.resolve(result);
163-
let launch=<IotLaunch>result.returnObject;
163+
let launch=<LaunchNode>result.returnObject;
164164
if(launch){
165165
result=launch.Remove();
166166
}else result = new IotResult(StatusResult.Error,`Launch not found IdLaunch:${idLaunch}`);
@@ -173,7 +173,7 @@ export class TreeDataLaunchsProvider implements vscode.TreeDataProvider<BaseTree
173173
let result:IotResult;
174174
result=this.GetLaunchbyIdLaunch(idLaunch);
175175
if(result.Status!=StatusResult.Ok) return Promise.resolve(result);
176-
let launch=<IotLaunch>result.returnObject;
176+
let launch=<LaunchNode>result.returnObject;
177177
//--------------Checks--------------
178178
//check device
179179
if(!launch.Device) {
@@ -200,11 +200,11 @@ export class TreeDataLaunchsProvider implements vscode.TreeDataProvider<BaseTree
200200
let jsonLinkedLaunchs=jsonLaunch.configurations.filter((e:any) => e.fastiotIdLaunch);
201201
jsonLinkedLaunchs=jsonLinkedLaunchs.filter((e:any) => e.fastiotIdLaunch.includes(launch.IdLaunch.substring(0,8)));
202202
//create a Message and get IotLaunch LinkedLaunchs
203-
let LinkedLaunchs:Array<IotLaunch>=[];
203+
let LinkedLaunchs:Array<LaunchNode>=[];
204204
let msg="\n";
205205
let index=1;
206206
jsonLinkedLaunchs.forEach((item:any) => {
207-
let launchItem = new IotLaunch(this._workspaceDirectory);
207+
let launchItem = new LaunchNode(this._workspaceDirectory);
208208
result=launchItem.FromJSON(item,this._devices);
209209
if(result.Status==StatusResult.Error) return Promise.resolve(result);
210210
LinkedLaunchs.push(launchItem);

src/TreeDataTemplatesProvider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as vscode from 'vscode';
22
import * as fs from 'fs';
33
import * as path from 'path';
44
import {BaseTreeItem} from './BaseTreeItem';
5-
import {IotLaunch} from './IotLaunch';
5+
import {LaunchNode} from './LaunchNode';
66
import {IotResult,StatusResult} from './IotResult';
77

88
export class TreeDataTemplatesProvider implements vscode.TreeDataProvider<BaseTreeItem> {
@@ -15,7 +15,7 @@ export class TreeDataTemplatesProvider implements vscode.TreeDataProvider<BaseTr
1515

1616
public getChildren(element?: BaseTreeItem): Thenable<BaseTreeItem[]> {
1717
//Creating a root structure
18-
let RootItems:Array<IotLaunch>=[];
18+
let RootItems:Array<LaunchNode>=[];
1919
return Promise.resolve(RootItems);
2020
}
2121

src/actionsLaunch/deleteLaunch.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import * as path from 'path';
44

55
import { TreeDataLaunchsProvider } from '../TreeDataLaunchsProvider';
66
import { IotResult,StatusResult } from '../IotResult';
7-
import { IotLaunch } from '../IotLaunch';
8-
import {IContexUI} from '../ui/IContexUI';
7+
import { LaunchNode } from '../LaunchNode';
8+
import { IContexUI } from '../ui/IContexUI';
99

10-
export async function deleteLaunch(treeData: TreeDataLaunchsProvider,item:IotLaunch,contextUI:IContexUI): Promise<void> {
10+
export async function deleteLaunch(treeData: TreeDataLaunchsProvider,item:LaunchNode,contextUI:IContexUI): Promise<void> {
1111
//Main process
1212
contextUI.Output(`Action: launch removal ${item.label} ${item.IdLaunch}`);
1313
contextUI.ShowBackgroundNotification(`Launch removal ${item.label} ${item.IdLaunch}`);

src/actionsLaunch/gotoDevice.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import * as path from 'path';
44

55
import { TreeDataLaunchsProvider } from '../TreeDataLaunchsProvider';
66
import { IotResult,StatusResult } from '../IotResult';
7-
import { IotLaunch } from '../IotLaunch';
7+
import { LaunchNode } from '../LaunchNode';
88
import { BaseTreeItem } from '../BaseTreeItem';
99

10-
export async function gotoDevice(item:IotLaunch,treeViewDevices:vscode.TreeView<BaseTreeItem>): Promise<void> {
10+
export async function gotoDevice(item:LaunchNode,treeViewDevices:vscode.TreeView<BaseTreeItem>): Promise<void> {
1111
const device = item.Device;
1212
//Set focus
1313
if(device) {

src/actionsLaunch/managementEnviroment.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import * as path from 'path';
44

55
import { TreeDataLaunchsProvider } from '../TreeDataLaunchsProvider';
66
import { IotResult,StatusResult } from '../IotResult';
7-
import { IotLaunchEnvironment } from '../IotLaunchEnvironment';
7+
import { LaunchEnvironmentNode } from '../LaunchEnvironmentNode';
88
import { IoTHelper } from '../Helper/IoTHelper';
99

10-
export async function addEnviroment(treeData: TreeDataLaunchsProvider,item:IotLaunchEnvironment):
10+
export async function addEnviroment(treeData: TreeDataLaunchsProvider,item:LaunchEnvironmentNode):
1111
Promise<void> {
1212
let launch=treeData.FindbyIdLaunchInTree(item.Launch.IdLaunch);
1313
if(launch)
@@ -44,7 +44,7 @@ export async function addEnviroment(treeData: TreeDataLaunchsProvider,item:IotLa
4444
}
4545
}
4646

47-
export async function renameEnviroment(treeData: TreeDataLaunchsProvider,item:IotLaunchEnvironment):
47+
export async function renameEnviroment(treeData: TreeDataLaunchsProvider,item:LaunchEnvironmentNode):
4848
Promise<void> {
4949
//name
5050
let newName = await vscode.window.showInputBox({
@@ -68,7 +68,7 @@ export async function renameEnviroment(treeData: TreeDataLaunchsProvider,item:Io
6868
}
6969
}
7070

71-
export async function editEnviroment(treeData: TreeDataLaunchsProvider,item:IotLaunchEnvironment):
71+
export async function editEnviroment(treeData: TreeDataLaunchsProvider,item:LaunchEnvironmentNode):
7272
Promise<void> {
7373
//value
7474
let newValue = await vscode.window.showInputBox({
@@ -91,7 +91,7 @@ export async function editEnviroment(treeData: TreeDataLaunchsProvider,item:IotL
9191
}
9292
}
9393

94-
export async function deleteEnviroment(treeData: TreeDataLaunchsProvider,item:IotLaunchEnvironment):
94+
export async function deleteEnviroment(treeData: TreeDataLaunchsProvider,item:LaunchEnvironmentNode):
9595
Promise<void> {
9696
let launch=treeData.FindbyIdLaunchInTree(item.Launch.IdLaunch);
9797
if(launch){

src/actionsLaunch/rebuildLaunch.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import * as path from 'path';
44

55
import { TreeDataLaunchsProvider } from '../TreeDataLaunchsProvider';
66
import { IotResult,StatusResult } from '../IotResult';
7-
import { IotLaunch } from '../IotLaunch';
8-
import {IContexUI} from '../ui/IContexUI';
7+
import { LaunchNode } from '../LaunchNode';
8+
import { IContexUI } from '../ui/IContexUI';
99

10-
export async function rebuildLaunch(treeData: TreeDataLaunchsProvider,item:IotLaunch,contextUI:IContexUI): Promise<void> {
10+
export async function rebuildLaunch(treeData: TreeDataLaunchsProvider,item:LaunchNode,contextUI:IContexUI): Promise<void> {
1111
//Main process
1212
contextUI.Output(`Action: rebuild Launch. Launch: ${item.label}`);
1313
contextUI.ShowBackgroundNotification(`Rebuild Launch. Launch: ${item.label}`);

0 commit comments

Comments
 (0)