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

Class: LayoutService

molecule.LayoutService

Hierarchy

Implements

Constructors

constructor

new LayoutService()

Overrides

Component.constructor

Defined in

services/workbench/layoutService.ts:99

Properties

_container

Private _container: null | HTMLElement

Defined in

services/workbench/layoutService.ts:98


state

Protected state: ILayout

Implementation of

ILayoutService.state

Overrides

Component.state

Defined in

services/workbench/layoutService.ts:97

Accessors

container

get container(): HTMLElement

Get the container of the molecule

Returns

HTMLElement

Implementation of

ILayoutService.container

Defined in

services/workbench/layoutService.ts:104

Methods

count

count(name): number

Count the service event

Parameters

NameTypeDescription
namestringEvent name

Returns

number

Implementation of

ILayoutService.count

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

Implementation of

ILayoutService.emit

Inherited from

Component.emit

Defined in

common/event/eventBus.ts:20


forceUpdate

forceUpdate(): void

Force to update the Component

Returns

void

Implementation of

ILayoutService.forceUpdate

Inherited from

Component.forceUpdate

Defined in

react/component.ts:81


getMenuBarMode

getMenuBarMode(): "horizontal" | "vertical"

Get the mode of the MenuBar

Returns

"horizontal" | "vertical"

Implementation of

ILayoutService.getMenuBarMode

Defined in

services/workbench/layoutService.ts:190


getState

getState(): ILayout

Get the Component state

Returns

ILayout

Implementation of

ILayoutService.getState

Inherited from

Component.getState

Defined in

react/component.ts:85


onUpdateState

onUpdateState(listener): void

Listen to the Component state update event

Parameters

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

Returns

void

Implementation of

ILayoutService.onUpdateState

Inherited from

Component.onUpdateState

Defined in

react/component.ts:73


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

Implementation of

ILayoutService.removeOnUpdateState

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?ILayout

Returns

void

Implementation of

ILayoutService.render

Inherited from

Component.render

Defined in

react/component.ts:69


reset

reset(): void

Reset all layout data as default value

Returns

void

Implementation of

ILayoutService.reset

Defined in

services/workbench/layoutService.ts:228


setAuxiliaryBar

setAuxiliaryBar(hidden): boolean

Set the visibility of auxiliary bar

Returns the next state of hidden

Parameters

NameType
hiddenboolean | (preState: boolean) => boolean

Returns

boolean

Implementation of

ILayoutService.setAuxiliaryBar

Defined in

services/workbench/layoutService.ts:211


setEditorGroupDirection

setEditorGroupDirection(direction): void

Set the direction of editor group,default is vertical

Parameters

NameType
directionMenuBarMode | (prev: MenuBarMode) => MenuBarMode

Returns

void

Implementation of

ILayoutService.setEditorGroupDirection

Defined in

services/workbench/layoutService.ts:195


setGroupSplitSize

setGroupSplitSize(groupSplitPos): void

Set the sizes between editor groups

Parameters

NameType
groupSplitPos(string | number)[]

Returns

void

Implementation of

ILayoutService.setGroupSplitSize

Defined in

services/workbench/layoutService.ts:175


setHorizontalPaneSize

setHorizontalPaneSize(horizontalSplitPanePos): void

Set the sizes between the editor and the panel

Parameters

NameType
horizontalSplitPanePos(string | number)[]

Returns

void

Implementation of

ILayoutService.setHorizontalPaneSize

Defined in

services/workbench/layoutService.ts:169


setMenuBarMode

setMenuBarMode(mode): void

Set the mode of the MenuBar, default is vertical

Parameters

NameType
mode"horizontal" | "vertical"

Returns

void

Implementation of

ILayoutService.setMenuBarMode

Defined in

services/workbench/layoutService.ts:181


setPaneSize

setPaneSize(splitPanePos): void

Set the sizes between the side bar and main content area

Parameters

NameType
splitPanePos(string | number)[]

Returns

void

Implementation of

ILayoutService.setPaneSize

Defined in

services/workbench/layoutService.ts:166


setSideBarPosition

setSideBarPosition(position): void

Set the position of the side bar, default is in left

Parameters

NameType
position"right" | "left"

Returns

void

Implementation of

ILayoutService.setSideBarPosition

Defined in

services/workbench/layoutService.ts:145


setState

setState(values, callback?): void

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

Parameters

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

Returns

void

Implementation of

ILayoutService.setState

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

Implementation of

ILayoutService.subscribe

Inherited from

Component.subscribe

Defined in

common/event/eventBus.ts:11


toggleActivityBarVisibility

toggleActivityBarVisibility(): boolean

Toggle the visibility of the activity bar, returns the status of activity bar's hidden

Returns

boolean

Implementation of

ILayoutService.toggleActivityBarVisibility

Defined in

services/workbench/layoutService.ts:131


toggleMenuBarVisibility

toggleMenuBarVisibility(): boolean

Toggle the visibility of menu bar, returns the status of menu bar's hidden

Returns

boolean

Implementation of

ILayoutService.toggleMenuBarVisibility

Defined in

services/workbench/layoutService.ts:110


togglePanelMaximized

togglePanelMaximized(): boolean

Toggle the maximized status of the panel, returns the status of maximized panel

Returns

boolean

Implementation of

ILayoutService.togglePanelMaximized

Defined in

services/workbench/layoutService.ts:155


togglePanelVisibility

togglePanelVisibility(): boolean

Toggle the visibility of the panel, returns the status of panel's hidden

Returns

boolean

Implementation of

ILayoutService.togglePanelVisibility

Defined in

services/workbench/layoutService.ts:117


toggleSidebarVisibility

toggleSidebarVisibility(): boolean

Toggle the visibility of side bar, returns the status of side bar's hidden

Returns

boolean

Implementation of

ILayoutService.toggleSidebarVisibility

Defined in

services/workbench/layoutService.ts:124


toggleStatusBarVisibility

toggleStatusBarVisibility(): boolean

Toggle the visibility of the status bar, returns the status of status bar's hidden

Returns

boolean

Implementation of

ILayoutService.toggleStatusBarVisibility

Defined in

services/workbench/layoutService.ts:138


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

Implementation of

ILayoutService.unsubscribe

Inherited from

Component.unsubscribe

Defined in

common/event/eventBus.ts:37