import { ThemeIcon } from "vscode" ; import { Explorer } from "../constants" ; import { Jdtls } from "../java/jdtls" ; import { INodeData } from "../java/nodeData" ; import { DataNode } from "./dataNode" ; import { ExplorerNode } from "./explorerNode" ; import { ProjectNode } from "./projectNode" ; export class WorkspaceNode extends DataNode { constructor ( nodeData , parent ? ) { super ( nodeData , parent ) ; } protected async loadData ( ) { if ( ! this . nodeData . uri ) { return undefined ; } return Jdtls . getProjects ( this . nodeData . uri ) ; } protected createChildNodeList ( ) { const result = [ ] ; if ( this . nodeData . children && this . nodeData . children . length ) { this . nodeData . children . forEach ( ( nodeData ) => { result . push ( new ProjectNode ( nodeData , this ) ) ; } ) ; } return result ; } protected get iconPath ( ) : ThemeIcon { return new ThemeIcon ( "root-folder" ) ; } protected get contextValue ( ) : string { return Explorer . ContextValueType . WorkspaceFolder ; } }