mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-30 09:35:39 -05:00
Move Tasks Panel (#5162)
* moving tasks panel * fix css styling * clean up code * do a bunch of renaming
This commit is contained in:
52
src/sql/workbench/parts/tasks/browser/tasksDataSource.ts
Normal file
52
src/sql/workbench/parts/tasks/browser/tasksDataSource.ts
Normal file
@@ -0,0 +1,52 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { ITree, IDataSource } from 'vs/base/parts/tree/browser/tree';
|
||||
import { TaskNode } from 'sql/platform/tasks/common/tasksNode';
|
||||
|
||||
/**
|
||||
* Implements the DataSource(that returns a parent/children of an element) for the task history
|
||||
*/
|
||||
export class TaskHistoryDataSource implements IDataSource {
|
||||
|
||||
/**
|
||||
* Returns the unique identifier of the given element.
|
||||
* No more than one element may use a given identifier.
|
||||
*/
|
||||
public getId(tree: ITree, element: any): string {
|
||||
if (element instanceof TaskNode) {
|
||||
return (<TaskNode>element).id;
|
||||
} else {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a boolean value indicating whether the element has children.
|
||||
*/
|
||||
public hasChildren(tree: ITree, element: any): boolean {
|
||||
if (element instanceof TaskNode) {
|
||||
return (<TaskNode>element).hasChildren;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the element's children as an array in a promise.
|
||||
*/
|
||||
public getChildren(tree: ITree, element: any): Promise<any> {
|
||||
if (element instanceof TaskNode) {
|
||||
return Promise.resolve((<TaskNode>element).children);
|
||||
}
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the element's parent in a promise.
|
||||
*/
|
||||
public getParent(tree: ITree, element: any): Promise<any> {
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user