-
Notifications
You must be signed in to change notification settings - Fork 82
/
Copy pathfileNode.ts
43 lines (35 loc) · 1.14 KB
/
fileNode.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
import { Command, ThemeIcon, Uri } from "vscode";
import { Commands } from "../commands";
import { Explorer } from "../constants";
import { INodeData } from "../java/nodeData";
import { DataNode } from "./dataNode";
import { ExplorerNode } from "./explorerNode";
export class FileNode extends DataNode {
constructor(nodeData: INodeData, parent: DataNode) {
super(nodeData, parent);
}
protected hasChildren(): boolean {
return false;
}
protected async loadData(): Promise<INodeData[] | undefined> {
return undefined;
}
protected createChildNodeList(): ExplorerNode[] | undefined {
return undefined;
}
protected get iconPath(): ThemeIcon {
return ThemeIcon.File;
}
protected get command(): Command {
return {
title: "Open file",
command: Commands.VSCODE_OPEN,
arguments: [Uri.parse(this.uri || ""), { preserveFocus: true }],
};
}
protected get contextValue(): string {
return Explorer.ContextValueType.File;
}
}