mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-12 02:58:31 -05:00
SQL Operations Studio Public Preview 1 (0.23) release source code
This commit is contained in:
72
src/sql/parts/fileBrowser/common/fileNode.ts
Normal file
72
src/sql/parts/fileBrowser/common/fileNode.ts
Normal file
@@ -0,0 +1,72 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
import { generateUuid } from 'vs/base/common/uuid';
|
||||
|
||||
/**
|
||||
* File/folder node in file browser
|
||||
* FileTreeNode is converted to this FileNode for UI interactions
|
||||
*/
|
||||
export class FileNode {
|
||||
/**
|
||||
* Node id
|
||||
*/
|
||||
public id: string;
|
||||
|
||||
/**
|
||||
* Connection uri
|
||||
*/
|
||||
public ownerUri: string;
|
||||
|
||||
/**
|
||||
* File or folder name
|
||||
*/
|
||||
public name: string;
|
||||
|
||||
/**
|
||||
* Full path of file or folder
|
||||
*/
|
||||
public fullPath: string;
|
||||
|
||||
/**
|
||||
* Parent node
|
||||
*/
|
||||
public parent: FileNode;
|
||||
|
||||
/**
|
||||
* Children nodes
|
||||
*/
|
||||
public children: FileNode[];
|
||||
|
||||
/**
|
||||
* Is the node expanded
|
||||
*/
|
||||
public isExpanded: boolean;
|
||||
|
||||
/**
|
||||
* Is the node file or folder
|
||||
*/
|
||||
public isFile: boolean;
|
||||
|
||||
/**
|
||||
* Does this node have children
|
||||
*/
|
||||
public hasChildren: boolean;
|
||||
|
||||
constructor(id: string, name: string, fullPath: string, isFile: boolean, isExpanded: boolean, ownerUri: string, parent:FileNode) {
|
||||
if (id) {
|
||||
this.id = id;
|
||||
} else {
|
||||
this.id = generateUuid();
|
||||
}
|
||||
|
||||
this.name = name;
|
||||
this.fullPath = fullPath;
|
||||
this.isFile = isFile;
|
||||
this.ownerUri = ownerUri;
|
||||
this.isExpanded = isExpanded;
|
||||
this.parent = parent;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user