Skip to main content

Interface: IFolderTreeService

services.IFolderTreeService

Hierarchy

Table of contents

Properties

Methods

Properties

getExpandKeys

getExpandKeys: () => UniqueId[]

Type declaration

▸ (): UniqueId[]

Get the expandKeys in folderTree

Returns

UniqueId[]

Defined in

src/services/workbench/explorer/folderTreeService.ts:52


getFileContextMenu

getFileContextMenu: () => IMenuItemProps[]

Type declaration

▸ (): IMenuItemProps[]

Get the context menus for file

Returns

IMenuItemProps[]

Defined in

src/services/workbench/explorer/folderTreeService.ts:44


getFolderContextMenu

getFolderContextMenu: () => IMenuItemProps[]

Type declaration

▸ (): IMenuItemProps[]

Get the context menus for folder

Returns

IMenuItemProps[]

Defined in

src/services/workbench/explorer/folderTreeService.ts:48


getLoadedKeys

getLoadedKeys: () => string[]

Type declaration

▸ (): string[]

Get the loadedKeys for folderTree

Returns

string[]

Defined in

src/services/workbench/explorer/folderTreeService.ts:60


setExpandKeys

setExpandKeys: (expandKeys: UniqueId[]) => void

Type declaration

▸ (expandKeys): void

Set the expandKeys for folderTree

Parameters
NameType
expandKeysUniqueId[]
Returns

void

Defined in

src/services/workbench/explorer/folderTreeService.ts:56


setFileContextMenu

setFileContextMenu: (menus: IMenuItemProps[]) => void

Type declaration

▸ (menus): void

Set the context menus for file

Parameters
NameType
menusIMenuItemProps[]
Returns

void

Defined in

src/services/workbench/explorer/folderTreeService.ts:80


setFolderContextMenu

setFolderContextMenu: (menus: IMenuItemProps[]) => void

Type declaration

▸ (menus): void

Set the context menus for folder

Parameters
NameType
menusIMenuItemProps[]
Returns

void

Defined in

src/services/workbench/explorer/folderTreeService.ts:85


setLoadedKeys

setLoadedKeys: (loadedKeys: string[]) => void

Type declaration

▸ (loadedKeys): void

Set the loadedKeys for folderTree

Parameters
NameType
loadedKeysstring[]
Returns

void

Defined in

src/services/workbench/explorer/folderTreeService.ts:64


state

Protected Abstract state: IFolderTree

Inherited from

Component.state

Defined in

src/react/component.ts:44

Methods

add

add(data, id?): void

Add data into folder tree

Parameters

NameTypeDescription
dataIFolderTreeNodeProps
id?UniqueIdExcept adding a root folder, the id is required

Returns

void

Defined in

src/services/workbench/explorer/folderTreeService.ts:20


get

get(id): null | IFolderTreeNodeProps

Get specific data in folder tree

Parameters

NameType
idUniqueId

Returns

null | IFolderTreeNodeProps

Defined in

src/services/workbench/explorer/folderTreeService.ts:35


getParentNode

getParentNode(id): null | IFolderTreeNodeProps

get the current treeNode's parentNode

Parameters

NameType
idUniqueId

Returns

null | IFolderTreeNodeProps

Defined in

src/services/workbench/explorer/folderTreeService.ts:40


onContextMenu

onContextMenu(callback): void

Listen to the click event about the context menu except for built-in menus

Parameters

NameType
callback(contextMenu: IMenuItemProps, treeNode?: IFolderTreeNodeProps) => void

Returns

void

Defined in

src/services/workbench/explorer/folderTreeService.ts:132


onCreate

onCreate(callback): void

Listen to create a node for folder tree

Parameters

NameType
callback(type: "File" | "Folder" | "RootFolder", nodeId?: UniqueId) => void

Returns

void

Defined in

src/services/workbench/explorer/folderTreeService.ts:127


onDropTree

onDropTree(callback): void

Listen to drop event

Parameters

NameType
callback(source: IFolderTreeNodeProps, target: IFolderTreeNodeProps) => void

Returns

void

Defined in

src/services/workbench/explorer/folderTreeService.ts:110


onExpandKeys

onExpandKeys(callback): void

Callback for expanding tree node

Parameters

NameType
callback(expandKeys: UniqueId[]) => void

Returns

void

Defined in

src/services/workbench/explorer/folderTreeService.ts:152


onLoadData

onLoadData(callback): void

Callback for load folder tree data

Parameters

NameType
callback(treeNode: IFolderTreeNodeProps, callback: (treeNode: IFolderTreeNodeProps) => void) => void

Returns

void

Defined in

src/services/workbench/explorer/folderTreeService.ts:142


onRemove

onRemove(callback): void

Listen to remove a node

Parameters

NameType
callback(id: UniqueId) => void

Returns

void

Defined in

src/services/workbench/explorer/folderTreeService.ts:95


onRename

onRename(callback): void

Listen to event about clicking rename button

Parameters

NameType
callback(id: UniqueId) => void

Returns

void

Defined in

src/services/workbench/explorer/folderTreeService.ts:90


onRightClick

onRightClick(callback): void

Listen to right click event

Parameters

NameType
callback(treeData: IFolderTreeNodeProps, menus: IMenuItemProps[]) => void

Returns

void

Defined in

src/services/workbench/explorer/folderTreeService.ts:120


onSelectFile

onSelectFile(callback): void

Listen to select a file

Parameters

NameType
callback(file: IFolderTreeNodeProps) => void

Returns

void

Defined in

src/services/workbench/explorer/folderTreeService.ts:105


onUpdateFileName

onUpdateFileName(callback): void

Listen to update file or folder name

Parameters

NameType
callback(file: IFolderTreeNodeProps) => void

Returns

void

Defined in

src/services/workbench/explorer/folderTreeService.ts:100


remove

remove(id): void

Remove specific data in folder tree

Parameters

NameType
idUniqueId

Returns

void

Defined in

src/services/workbench/explorer/folderTreeService.ts:25


reset

reset(): void

Reset the FolderTreeService state

Returns

void

Defined in

src/services/workbench/explorer/folderTreeService.ts:14


setActive

setActive(id?): void

Active specific node, or unactive any node in folder tree

Parameters

NameType
id?UniqueId

Returns

void

Defined in

src/services/workbench/explorer/folderTreeService.ts:70


setEntry

setEntry(entry): void

Set a entry page for folder tree

Parameters

NameType
entryReactNode

Returns

void

Defined in

src/services/workbench/explorer/folderTreeService.ts:75


subscribe

subscribe(name, listener): void

Subscribe the service event

Parameters

NameTypeDescription
namestring | string[]Event name
listenerFunctionListener function

Returns

void

Inherited from

Component.subscribe

Defined in

src/common/event/eventBus.ts:11


toggleAutoSort

toggleAutoSort(): void

Toggle whether to enable sorting, which is disabled by default.

Returns

void

Defined in

src/services/workbench/explorer/folderTreeService.ts:156


unsubscribe

unsubscribe(name, listener?): void

Unsubscribe the specific event and the listener function

Parameters

NameTypeDescription
nameanyThe event name
listener?Functionoptional, it unsubscribes events via name if not pass the listener function

Returns

void

Inherited from

Component.unsubscribe

Defined in

src/common/event/eventBus.ts:39


update

update(data): void

Update specific data in folder tree

Parameters

NameTypeDescription
dataIFolderTreeNodePropsThe id property is required in data

Returns

void

Defined in

src/services/workbench/explorer/folderTreeService.ts:30