views.ts 1.1 KB
Newer Older
S
Sandeep Somavarapu 已提交
1 2 3 4 5 6 7 8 9 10 11
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

import { TPromise } from 'vs/base/common/winjs.base';
import Event from 'vs/base/common/event';
import { Command } from 'vs/editor/common/modes';

export type TreeViewItemHandleArg = {
	$treeViewId: string,
S
Sandeep Somavarapu 已提交
12
	$treeItemHandle: string
S
Sandeep Somavarapu 已提交
13 14 15 16 17 18 19 20 21 22
};

export enum TreeItemCollapsibleState {
	None = 0,
	Collapsed = 1,
	Expanded = 2
}

export interface ITreeItem {

S
Sandeep Somavarapu 已提交
23
	handle: string;
S
Sandeep Somavarapu 已提交
24

S
Sandeep Somavarapu 已提交
25 26
	parentHandle: string;

S
Sandeep Somavarapu 已提交
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
	label: string;

	icon?: string;

	iconDark?: string;

	contextValue?: string;

	command?: Command;

	children?: ITreeItem[];

	collapsibleState?: TreeItemCollapsibleState;
}

export interface ITreeViewDataProvider {

S
Sandeep Somavarapu 已提交
44
	onDidChange: Event<ITreeItem[] | undefined | null>;
S
Sandeep Somavarapu 已提交
45

S
Sandeep Somavarapu 已提交
46 47
	onDispose: Event<void>;

S
Sandeep Somavarapu 已提交
48 49 50 51
	getElements(): TPromise<ITreeItem[]>;

	getChildren(element: ITreeItem): TPromise<ITreeItem[]>;
}