Interface: IFolderTreeService
molecule.IFolderTreeService
Hierarchy
↳
IFolderTreeService
Implemented by
Properties
state
• Protected
Abstract
state: IFolderTree
Inherited from
Defined in
Methods
add
▸ add(data
, id?
): void
Add data into folder tree
Parameters
Name | Type | Description |
---|---|---|
data | IFolderTreeNodeProps | |
id? | UniqueId | Except adding a root folder, the id is required |
Returns
void
Defined in
src/services/workbench/explorer/folderTreeService.ts:31
count
▸ count(name
): number
Count the service event
Parameters
Name | Type | Description |
---|---|---|
name | string | Event name |
Returns
number
Inherited from
Defined in
src/common/event/eventBus.ts:28
emit
▸ emit(name
, ...args
): void
Emit the service event
Parameters
Name | Type | Description |
---|---|---|
name | string | Event name |
...args | any | Arguments |
Returns
void
Inherited from
Defined in
src/common/event/eventBus.ts:20
forceUpdate
▸ forceUpdate(): void
Force to update the Component
Returns
void
Inherited from
Defined in
get
▸ get(id
): null
| IFolderTreeNodeProps
Get specific data in folder tree
Parameters
Name | Type |
---|---|
id | UniqueId |
Returns
null
| IFolderTreeNodeProps
Defined in
src/services/workbench/explorer/folderTreeService.ts:46
getFileContextMenu
▸ getFileContextMenu(): IMenuItemProps
[]
Get the context menus for file
Returns
Defined in
src/services/workbench/explorer/folderTreeService.ts:50
getFolderContextMenu
▸ getFolderContextMenu(): IMenuItemProps
[]
Get the context menus for folder
Returns
Defined in
src/services/workbench/explorer/folderTreeService.ts:54
getState
▸ getState(): IFolderTree
Get the Component state
Returns
Inherited from
Defined in
onContextMenu
▸ onContextMenu(callback
): void
Listen to the click event about the context menu except for built-in menus
Parameters
Name | Type |
---|---|
callback | (contextMenu : IMenuItemProps , treeNode? : IFolderTreeNodeProps ) => void |
Returns
void
Defined in
src/services/workbench/explorer/folderTreeService.ts:125
onCreate
▸ onCreate(callback
): void
Listen to create a node for folder tree
Parameters
Name | Type |
---|---|
callback | (type : "File" | "Folder" | "RootFolder" , nodeId? : UniqueId ) => void |
Returns
void
Defined in
src/services/workbench/explorer/folderTreeService.ts:120
onDropTree
▸ onDropTree(callback
): void
Listen to drop event
Parameters
Name | Type |
---|---|
callback | (source : IFolderTreeNodeProps , target : IFolderTreeNodeProps ) => void |
Returns
void
Defined in
src/services/workbench/explorer/folderTreeService.ts:100
onLoadData
▸ onLoadData(callback
): void
Callback for load folder tree data
Parameters
Name | Type |
---|---|
callback | (treeNode : IFolderTreeNodeProps , callback : (treeNode : IFolderTreeNodeProps ) => void ) => void |
Returns
void
Defined in
src/services/workbench/explorer/folderTreeService.ts:135
onRemove
▸ onRemove(callback
): void
Listen to remove a node
Parameters
Name | Type |
---|---|
callback | (id : UniqueId ) => void |
Returns
void
Defined in
src/services/workbench/explorer/folderTreeService.ts:85
onRename
▸ onRename(callback
): void
Listen to event about clicking rename button
Parameters
Name | Type |
---|---|
callback | (id : UniqueId ) => void |
Returns
void
Defined in
src/services/workbench/explorer/folderTreeService.ts:80
onRightClick
▸ onRightClick(callback
): void
Listen to right click event
Parameters
Name | Type |
---|---|
callback | (treeData : IFolderTreeNodeProps , menus : IMenuItemProps []) => void |
Returns
void
Defined in
src/services/workbench/explorer/folderTreeService.ts:110
onSelectFile
▸ onSelectFile(callback
): void
Listen to select a file
Parameters
Name | Type |
---|---|
callback | (file : IFolderTreeNodeProps ) => void |
Returns
void
Defined in
src/services/workbench/explorer/folderTreeService.ts:95
onUpdateFileName
▸ onUpdateFileName(callback
): void
Listen to update file or folder name
Parameters
Name | Type |
---|---|
callback | (file : IFolderTreeNodeProps ) => void |
Returns
void
Defined in
src/services/workbench/explorer/folderTreeService.ts:90
onUpdateState
▸ onUpdateState(callback
): void
Listen to the Component state update event
Parameters
Name | Type |
---|---|
callback | (prevState : IFolderTree , nextState : IFolderTree ) => void |
Returns
void
Inherited from
Defined in
remove
▸ remove(id
): void
Remove specific data in folder tree
Parameters
Name | Type |
---|---|
id | UniqueId |
Returns
void
Defined in
src/services/workbench/explorer/folderTreeService.ts:36
removeOnUpdateState
▸ removeOnUpdateState(): void
Remove the Component update event listening
Returns
void
Inherited from
Defined in
render
▸ render(nextState?
): void
Initiative notify the component to render the view by the state
Parameters
Name | Type |
---|---|
nextState? | IFolderTree |
Returns
void
Inherited from
Defined in
reset
▸ reset(): void
Reset the FolderTreeService state
Returns
void
Defined in
src/services/workbench/explorer/folderTreeService.ts:25
setActive
▸ setActive(id?
): void
Active specific node, or unactive any node in folder tree
Parameters
Name | Type |
---|---|
id? | UniqueId |
Returns
void
Defined in
src/services/workbench/explorer/folderTreeService.ts:60
setEntry
▸ setEntry(entry
): void
Set a entry page for folder tree
Parameters
Name | Type |
---|---|
entry | ReactNode |
Returns
void
Defined in
src/services/workbench/explorer/folderTreeService.ts:65
setFileContextMenu
▸ setFileContextMenu(menus
): void
Set the context menus for file
Parameters
Name | Type |
---|---|
menus | IMenuItemProps [] |
Returns
void
Defined in
src/services/workbench/explorer/folderTreeService.ts:70
setFolderContextMenu
▸ setFolderContextMenu(menus
): void
Set the context menus for folder
Parameters
Name | Type |
---|---|
menus | IMenuItemProps [] |
Returns
void
Defined in
src/services/workbench/explorer/folderTreeService.ts:75
setState
▸ setState(values
, callback?
): void
Set the state values, and notify the view component to re render
Parameters
Name | Type | Description |
---|---|---|
values | Partial <IFolderTree > | update target state values |
callback? | (prevState : IFolderTree , nextState : IFolderTree ) => void | - |
Returns
void
Inherited from
Defined in
subscribe
▸ subscribe(name
, callback
): void
Subscribe the service event
Parameters
Name | Type | Description |
---|---|---|
name | string | string [] | Event name |
callback | Function | Callback function |
Returns
void
Inherited from
Defined in
src/common/event/eventBus.ts:11
unsubscribe
▸ unsubscribe(name
): void
Unsubscribe the specific event
Parameters
Name | Type | Description |
---|---|---|
name | any | The event name |
Returns
void
Inherited from
Defined in
src/common/event/eventBus.ts:37
update
▸ update(data
): void
Update specific data in folder tree
Parameters
Name | Type | Description |
---|---|---|
data | IFolderTreeNodeProps | The id property is required in data |
Returns
void