跳到主要内容
版本:1.x

Interface: IFolderTreeService

molecule.IFolderTreeService

Hierarchy

Implemented by

Properties

state

Protected Abstract state: IFolderTree

Inherited from

Component.state

Defined in

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

services/workbench/explorer/folderTreeService.ts:31


count

count(name): number

Count the service event

Parameters

NameTypeDescription
namestringEvent name

Returns

number

Inherited from

Component.count

Defined in

common/event/eventBus.ts:28


emit

emit(name, ...args): void

Emit the service event

Parameters

NameTypeDescription
namestringEvent name
...argsanyArguments

Returns

void

Inherited from

Component.emit

Defined in

common/event/eventBus.ts:20


forceUpdate

forceUpdate(): void

Force to update the Component

Returns

void

Inherited from

Component.forceUpdate

Defined in

react/component.ts:81


get

get(id): null | IFolderTreeNodeProps

Get specific data in folder tree

Parameters

NameType
idUniqueId

Returns

null | IFolderTreeNodeProps

Defined in

services/workbench/explorer/folderTreeService.ts:46


getExpandKeys

getExpandKeys(): UniqueId[]

Get the expandKeys in folderTree

Returns

UniqueId[]

Defined in

services/workbench/explorer/folderTreeService.ts:63


getFileContextMenu

getFileContextMenu(): IMenuItemProps[]

Get the context menus for file

Returns

IMenuItemProps[]

Defined in

services/workbench/explorer/folderTreeService.ts:55


getFolderContextMenu

getFolderContextMenu(): IMenuItemProps[]

Get the context menus for folder

Returns

IMenuItemProps[]

Defined in

services/workbench/explorer/folderTreeService.ts:59


getLoadedKeys

getLoadedKeys(): string[]

Get the loadedKeys for folderTree

Returns

string[]

Defined in

services/workbench/explorer/folderTreeService.ts:71


getParentNode

getParentNode(id): null | IFolderTreeNodeProps

get the current treeNode's parentNode

Parameters

NameType
idUniqueId

Returns

null | IFolderTreeNodeProps

Defined in

services/workbench/explorer/folderTreeService.ts:51


getState

getState(): IFolderTree

Get the Component state

Returns

IFolderTree

Inherited from

Component.getState

Defined in

react/component.ts:85


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

services/workbench/explorer/folderTreeService.ts:146


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

services/workbench/explorer/folderTreeService.ts:141


onDropTree

onDropTree(callback): void

Listen to drop event

Parameters

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

Returns

void

Defined in

services/workbench/explorer/folderTreeService.ts:121


onExpandKeys

onExpandKeys(callback): void

Callback for expanding tree node

Parameters

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

Returns

void

Defined in

services/workbench/explorer/folderTreeService.ts:166


onLoadData

onLoadData(callback): void

Callback for load folder tree data

Parameters

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

Returns

void

Defined in

services/workbench/explorer/folderTreeService.ts:156


onRemove

onRemove(callback): void

Listen to remove a node

Parameters

NameType
callback(id: UniqueId) => void

Returns

void

Defined in

services/workbench/explorer/folderTreeService.ts:106


onRename

onRename(callback): void

Listen to event about clicking rename button

Parameters

NameType
callback(id: UniqueId) => void

Returns

void

Defined in

services/workbench/explorer/folderTreeService.ts:101


onRightClick

onRightClick(callback): void

Listen to right click event

Parameters

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

Returns

void

Defined in

services/workbench/explorer/folderTreeService.ts:131


onSelectFile

onSelectFile(callback): void

Listen to select a file

Parameters

NameType
callback(file: IFolderTreeNodeProps) => void

Returns

void

Defined in

services/workbench/explorer/folderTreeService.ts:116


onUpdateFileName

onUpdateFileName(callback): void

Listen to update file or folder name

Parameters

NameType
callback(file: IFolderTreeNodeProps) => void

Returns

void

Defined in

services/workbench/explorer/folderTreeService.ts:111


onUpdateState

onUpdateState(listener): void

Listen to the Component state update event

Parameters

NameType
listener(prevState: IFolderTree, nextState: IFolderTree) => void

Returns

void

Inherited from

Component.onUpdateState

Defined in

react/component.ts:73


remove

remove(id): void

Remove specific data in folder tree

Parameters

NameType
idUniqueId

Returns

void

Defined in

services/workbench/explorer/folderTreeService.ts:36


removeOnUpdateState

removeOnUpdateState(listener?): void

Remove the Component update event listening, default is remove all, also you can remove one by pass the listener

Parameters

NameType
listener?Function

Returns

void

Inherited from

Component.removeOnUpdateState

Defined in

react/component.ts:77


render

render(nextState?): void

Initiative notify the component to render the view by the state

Parameters

NameType
nextState?IFolderTree

Returns

void

Inherited from

Component.render

Defined in

react/component.ts:69


reset

reset(): void

Reset the FolderTreeService state

Returns

void

Defined in

services/workbench/explorer/folderTreeService.ts:25


setActive

setActive(id?): void

Active specific node, or unactive any node in folder tree

Parameters

NameType
id?UniqueId

Returns

void

Defined in

services/workbench/explorer/folderTreeService.ts:81


setEntry

setEntry(entry): void

Set a entry page for folder tree

Parameters

NameType
entryReactNode

Returns

void

Defined in

services/workbench/explorer/folderTreeService.ts:86


setExpandKeys

setExpandKeys(expandKeys): void

Set the expandKeys for folderTree

Parameters

NameType
expandKeysUniqueId[]

Returns

void

Defined in

services/workbench/explorer/folderTreeService.ts:67


setFileContextMenu

setFileContextMenu(menus): void

Set the context menus for file

Parameters

NameType
menusIMenuItemProps[]

Returns

void

Defined in

services/workbench/explorer/folderTreeService.ts:91


setFolderContextMenu

setFolderContextMenu(menus): void

Set the context menus for folder

Parameters

NameType
menusIMenuItemProps[]

Returns

void

Defined in

services/workbench/explorer/folderTreeService.ts:96


setLoadedKeys

setLoadedKeys(loadedKeys): void

Set the loadedKeys for folderTree

Parameters

NameType
loadedKeysstring[]

Returns

void

Defined in

services/workbench/explorer/folderTreeService.ts:75


setState

setState(values, callback?): void

Set the state values, and notify the view component to re render

Parameters

NameTypeDescription
valuesPartial<IFolderTree>update target state values
callback?(prevState: IFolderTree, nextState: IFolderTree) => void-

Returns

void

Inherited from

Component.setState

Defined in

react/component.ts:56


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

common/event/eventBus.ts:11


toggleAutoSort

toggleAutoSort(): void

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

Returns

void

Defined in

services/workbench/explorer/folderTreeService.ts:170


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

common/event/eventBus.ts:37


update

update(data): void

Update specific data in folder tree

Parameters

NameTypeDescription
dataIFolderTreeNodePropsThe id property is required in data

Returns

void

Defined in

services/workbench/explorer/folderTreeService.ts:41