import { ThemeIcon } from 'vscode' ; import { AzExtParentTreeItem , TreeItemIconPath } from 'vscode-azureextensionui' ; import { localize } from '../localize' ; import { IProjectTreeItem } from './IProjectTreeItem' ; import { getProjectContextValue , ProjectAccess , ProjectResource } from './projectContextValues' ; export abstract class FunctionsTreeItemBase extends AzExtParentTreeItem { public readonly label : string = localize ( 'Functions' , 'Functions' ) ; public readonly childTypeLabel : string = localize ( 'Function' , 'Function' ) ; public parent : AzExtParentTreeItem & IProjectTreeItem ; public suppressMaskLabel : boolean = true ; public abstract isReadOnly : boolean ; public constructor ( parent ) { super ( parent ) ; } public get contextValue ( ) : string { return getProjectContextValue ( this . parent . source , this . access , ProjectResource . Functions ) ; } public get description ( ) : string { return this . isReadOnly ? localize ( 'readOnly' , 'Read-only' ) : '' ; } public get access ( ) : ProjectAccess { return this . isReadOnly ? ProjectAccess . ReadOnly : ProjectAccess . ReadWrite ; } public get id ( ) : string { return 'functions' ; } public get iconPath ( ) : TreeItemIconPath { return new ThemeIcon ( 'list-unordered' ) ; } }