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

Class: LayoutService

molecule.LayoutService

Hierarchy

Implements

Constructors

constructor

new LayoutService()

Overrides

Component.constructor

Defined in

src/services/workbench/layoutService.ts:78

Properties

_container

Private _container: null | HTMLElement

Defined in

src/services/workbench/layoutService.ts:77


state

Protected state: ILayout

Implementation of

ILayoutService.state

Overrides

Component.state

Defined in

src/services/workbench/layoutService.ts:76

Accessors

container

get container(): HTMLElement

Get the container of the molecule

Returns

HTMLElement

Implementation of

ILayoutService.container

Defined in

src/services/workbench/layoutService.ts:83

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

src/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

src/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

src/react/component.ts:79


getMenuBarMode

getMenuBarMode(): "horizontal" | "vertical"

Get the mode of the MenuBar

Returns

"horizontal" | "vertical"

Implementation of

ILayoutService.getMenuBarMode

Defined in

src/services/workbench/layoutService.ts:161


getState

getState(): ILayout

Get the Component state

Returns

ILayout

Implementation of

ILayoutService.getState

Inherited from

Component.getState

Defined in

src/react/component.ts:83


onUpdateState

onUpdateState(callback): void

Listen to the Component state update event

Parameters

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

Returns

void

Implementation of

ILayoutService.onUpdateState

Inherited from

Component.onUpdateState

Defined in

src/react/component.ts:71


removeOnUpdateState

removeOnUpdateState(): void

Remove the Component update event listening

Returns

void

Implementation of

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

Returns

void

Implementation of

ILayoutService.render

Inherited from

Component.render

Defined in

src/react/component.ts:67


reset

reset(): void

Reset all layout data as default value

Returns

void

Implementation of

ILayoutService.reset

Defined in

src/services/workbench/layoutService.ts:166


setHorizontalPaneSize

setHorizontalPaneSize(horizontalSplitPanePos): void

Set the sizes between the editor and the panel

Parameters

NameType
horizontalSplitPanePosstring[]

Returns

void

Implementation of

ILayoutService.setHorizontalPaneSize

Defined in

src/services/workbench/layoutService.ts:149


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

src/services/workbench/layoutService.ts:153


setPaneSize

setPaneSize(splitPanePos): void

Set the sizes between the side bar and main content area

Parameters

NameType
splitPanePosstring[]

Returns

void

Implementation of

ILayoutService.setPaneSize

Defined in

src/services/workbench/layoutService.ts:146


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

src/services/workbench/layoutService.ts:125


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

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

ILayoutService.subscribe

Inherited from

Component.subscribe

Defined in

src/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

src/services/workbench/layoutService.ts:111


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

src/services/workbench/layoutService.ts:90


togglePanelMaximized

togglePanelMaximized(): boolean

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

Returns

boolean

Implementation of

ILayoutService.togglePanelMaximized

Defined in

src/services/workbench/layoutService.ts:135


togglePanelVisibility

togglePanelVisibility(): boolean

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

Returns

boolean

Implementation of

ILayoutService.togglePanelVisibility

Defined in

src/services/workbench/layoutService.ts:97


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

src/services/workbench/layoutService.ts:104


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

src/services/workbench/layoutService.ts:118


unsubscribe

unsubscribe(name): void

Unsubscribe the specific event

Parameters

NameTypeDescription
nameanyThe event name

Returns

void

Implementation of

ILayoutService.unsubscribe

Inherited from

Component.unsubscribe

Defined in

src/common/event/eventBus.ts:37