跳到主要内容
版本:0.9.0-beta.2

Class: PanelService

molecule.PanelService

Hierarchy

Implements

Constructors

constructor

new PanelService()

Overrides

Component.constructor

Defined in

src/services/workbench/panelService.ts:114

Properties

builtinService

Private Readonly builtinService: IBuiltinService

Defined in

src/services/workbench/panelService.ts:112


layoutService

Private Readonly layoutService: LayoutService

Defined in

src/services/workbench/panelService.ts:111


state

Protected state: IPanel

Implementation of

IPanelService.state

Overrides

Component.state

Defined in

src/services/workbench/panelService.ts:110

Accessors

outputEditorInstance

get outputEditorInstance(): undefined | IStandaloneCodeEditor

The editorInstance of Output

Returns

undefined | IStandaloneCodeEditor

Implementation of

IPanelService.outputEditorInstance

Defined in

src/services/workbench/panelService.ts:131

Methods

add

add(data): void

Add new Panel items

Parameters

NameType
dataIPanelItem<any> | IPanelItem<any>[]

Returns

void

Implementation of

IPanelService.add

Defined in

src/services/workbench/panelService.ts:238


appendOutput

appendOutput(content): void

Append the content into Output panel

Parameters

NameType
contentstring

Returns

void

Implementation of

IPanelService.appendOutput

Defined in

src/services/workbench/panelService.ts:226


cleanOutput

cleanOutput(): void

Clean the Output content

Returns

void

Implementation of

IPanelService.cleanOutput

Defined in

src/services/workbench/panelService.ts:234


count

count(name): number

Count the service event

Parameters

NameTypeDescription
namestringEvent name

Returns

number

Implementation of

IPanelService.count

Inherited from

Component.count

Defined in

src/common/event/eventBus.ts:28


emit

emit(name, ...args): void

Emit the service event

Parameters

NameTypeDescription
namestringEvent name
...argsanyArguments

Returns

void

Implementation of

IPanelService.emit

Inherited from

Component.emit

Defined in

src/common/event/eventBus.ts:20


forceUpdate

forceUpdate(): void

Force to update the Component

Returns

void

Implementation of

IPanelService.forceUpdate

Inherited from

Component.forceUpdate

Defined in

src/react/component.ts:79


getOutputValue

getOutputValue(): any

Get the value of Output Panel

Returns

any

Implementation of

IPanelService.getOutputValue

Defined in

src/services/workbench/panelService.ts:205


getPanel

getPanel(id): undefined | IPanelItem<any>

Get the specific panel

Parameters

NameType
idUniqueId

Returns

undefined | IPanelItem<any>

Implementation of

IPanelService.getPanel

Defined in

src/services/workbench/panelService.ts:188


getState

getState(): IPanel

Get the Component state

Returns

IPanel

Implementation of

IPanelService.getState

Inherited from

Component.getState

Defined in

src/react/component.ts:83


onTabChange

onTabChange(callback): void

Listen to the Panel tabs onChange event

Parameters

NameType
callback(key: UniqueId) => void

Returns

void

Implementation of

IPanelService.onTabChange

Defined in

src/services/workbench/panelService.ts:291


onTabClose

onTabClose(callback): void

Listen to the Panel tabs close event

Parameters

NameType
callback(key: UniqueId) => void

Returns

void

Implementation of

IPanelService.onTabClose

Defined in

src/services/workbench/panelService.ts:301


onToolbarClick

onToolbarClick(callback): void

Listen to the Panel toolbar click event

Parameters

NameType
callback(e: MouseEvent<Element, MouseEvent>, item: IActionBarItemProps<any>) => void

Returns

void

Implementation of

IPanelService.onToolbarClick

Defined in

src/services/workbench/panelService.ts:295


onUpdateState

onUpdateState(callback): void

Listen to the Component state update event

Parameters

NameType
callback(prevState: IPanel, nextState: IPanel) => void

Returns

void

Implementation of

IPanelService.onUpdateState

Inherited from

Component.onUpdateState

Defined in

src/react/component.ts:71


open

open(data): void

Open a new or existing panel item as the active in Panel view

Parameters

NameType
dataIPanelItem<any>

Returns

void

Implementation of

IPanelService.open

Defined in

src/services/workbench/panelService.ts:172


remove

remove(id): undefined | IPanelItem<any>

Remove the specific panel

Parameters

NameType
idUniqueId

Returns

undefined | IPanelItem<any>

Implementation of

IPanelService.remove

Defined in

src/services/workbench/panelService.ts:266


removeOnUpdateState

removeOnUpdateState(): void

Remove the Component update event listening

Returns

void

Implementation of

IPanelService.removeOnUpdateState

Inherited from

Component.removeOnUpdateState

Defined in

src/react/component.ts:75


render

render(nextState?): void

Initiative notify the component to render the view by the state

Parameters

NameType
nextState?IPanel

Returns

void

Implementation of

IPanelService.render

Inherited from

Component.render

Defined in

src/react/component.ts:67


reset

reset(): void

Reset data in state

Returns

void

Implementation of

IPanelService.reset

Defined in

src/services/workbench/panelService.ts:282


setActive

setActive(id): void

Set the current active panel

This method will log error when couldn't find target panel in state data. So if you want to add a panel and meanwhile active it, please use the open method

Parameters

NameType
idUniqueId

Returns

void

Implementation of

IPanelService.setActive

Defined in

src/services/workbench/panelService.ts:139


setState

setState(values, callback?): void

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

Parameters

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

Returns

void

Implementation of

IPanelService.setState

Inherited from

Component.setState

Defined in

src/react/component.ts:54


subscribe

subscribe(name, callback): void

Subscribe the service event

Parameters

NameTypeDescription
namestring | string[]Event name
callbackFunctionCallback function

Returns

void

Implementation of

IPanelService.subscribe

Inherited from

Component.subscribe

Defined in

src/common/event/eventBus.ts:11


toggleMaximize

toggleMaximize(): void

Toggle the panel between maximized or normal

Returns

void

Implementation of

IPanelService.toggleMaximize

Defined in

src/services/workbench/panelService.ts:150


unsubscribe

unsubscribe(name): void

Unsubscribe the specific event

Parameters

NameTypeDescription
nameanyThe event name

Returns

void

Implementation of

IPanelService.unsubscribe

Inherited from

Component.unsubscribe

Defined in

src/common/event/eventBus.ts:37


update

update(data): undefined | IPanelItem<any>

Update the specific panel

Parameters

NameType
dataIPanelItem<any>

Returns

undefined | IPanelItem<any>

Implementation of

IPanelService.update

Defined in

src/services/workbench/panelService.ts:251


updateOutput

updateOutput(data): undefined | IPanelItem<any>

Onyl support to update several properties

Parameters

NameType
dataPartial<IPanelItem<any>>

Returns

undefined | IPanelItem<any>

Implementation of

IPanelService.updateOutput

Defined in

src/services/workbench/panelService.ts:214


updateOutputProperty

Private updateOutputProperty(data): undefined | IPanelItem<any>

Parameters

NameType
dataPartial<IPanelItem<string>>

Returns

undefined | IPanelItem<any>

Defined in

src/services/workbench/panelService.ts:121