Sprotty
Toggle Dark/Light/Auto modeToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeBack to homepage

Class. Command Palette

autoCompleteResult

protected autoCompleteResult: AutocompleteResult

Defined in: packages/sprotty/src/features/command-palette/command-palette.ts:51


containerElement

protected containerElement: HTMLElement

Defined in: packages/sprotty/src/base/ui-extensions/ui-extension.ts:47

Inherited from

AbstractUIExtension.containerElement


contextActions?

protected optional contextActions: LabeledAction[]

Defined in: packages/sprotty/src/features/command-palette/command-palette.ts:53


debounceWaitMs

protected debounceWaitMs: number = 100

Defined in: packages/sprotty/src/features/command-palette/command-palette.ts:46


defaultWidth

protected defaultWidth: number = 400

Defined in: packages/sprotty/src/features/command-palette/command-palette.ts:45


domHelper

protected domHelper: DOMHelper

Defined in: packages/sprotty/src/features/command-palette/command-palette.ts:58


inputElement

protected inputElement: HTMLInputElement

Defined in: packages/sprotty/src/features/command-palette/command-palette.ts:49


loadingIndicator

protected loadingIndicator: HTMLSpanElement

Defined in: packages/sprotty/src/features/command-palette/command-palette.ts:50


loadingIndicatorClasses

protected loadingIndicatorClasses: string[]

Defined in: packages/sprotty/src/features/command-palette/command-palette.ts:42


logger

protected logger: ILogger

Defined in: packages/sprotty/src/base/ui-extensions/ui-extension.ts:45

Inherited from

AbstractUIExtension.logger


mousePositionTracker

protected mousePositionTracker: MousePositionTracker

Defined in: packages/sprotty/src/features/command-palette/command-palette.ts:59


noCommandsMsg

protected noCommandsMsg: string = "No commands available"

Defined in: packages/sprotty/src/features/command-palette/command-palette.ts:47


options

protected options: ViewerOptions

Defined in: packages/sprotty/src/base/ui-extensions/ui-extension.ts:44

Inherited from

AbstractUIExtension.options


paletteIndex

protected paletteIndex: number = 0

Defined in: packages/sprotty/src/features/command-palette/command-palette.ts:52


viewerOptions

protected viewerOptions: ViewerOptions

Defined in: packages/sprotty/src/features/command-palette/command-palette.ts:57


xOffset

protected xOffset: number = 20

Defined in: packages/sprotty/src/features/command-palette/command-palette.ts:43


yOffset

protected yOffset: number = 20

Defined in: packages/sprotty/src/features/command-palette/command-palette.ts:44


ID

readonly static ID: "command-palette" = "command-palette"

Defined in: packages/sprotty/src/features/command-palette/command-palette.ts:39

Methods

autocompleteSettings()

protected autocompleteSettings(root): AutocompleteSettings<LabeledAction>

Defined in: packages/sprotty/src/features/command-palette/command-palette.ts:114

Parameters

root

Readonly<SModelRootImpl>

Returns

AutocompleteSettings<LabeledAction>


containerClass()

containerClass(): string

Defined in: packages/sprotty/src/features/command-palette/command-palette.ts:62

Returns

string

Overrides

AbstractUIExtension.containerClass


customizeSuggestionContainer()

protected customizeSuggestionContainer(container, inputRect, maxHeight): void

Defined in: packages/sprotty/src/features/command-palette/command-palette.ts:208

Parameters

container

HTMLDivElement

inputRect

DOMRect | ClientRect

maxHeight

number

Returns

void


cycle()

protected cycle(): void

Defined in: packages/sprotty/src/features/command-palette/command-palette.ts:91

Returns

void


cylceIfInvokePaletteKey()

protected cylceIfInvokePaletteKey(event): any

Defined in: packages/sprotty/src/features/command-palette/command-palette.ts:87

Parameters

event

KeyboardEvent

Returns

any


executeAction()

protected executeAction(input): void

Defined in: packages/sprotty/src/features/command-palette/command-palette.ts:223

Parameters

input

LabeledAction | Action | Action[]

Returns

void


filterActions()

protected filterActions(filterText, actions): LabeledAction[]

Defined in: packages/sprotty/src/features/command-palette/command-palette.ts:200

Parameters

filterText

string

actions

LabeledAction[]

Returns

LabeledAction[]


getCodicon()

protected getCodicon(iconId): string

Defined in: packages/sprotty/src/features/command-palette/command-palette.ts:196

Parameters

iconId

string

Returns

string


getFontAwesomeIcon()

protected getFontAwesomeIcon(iconId): string

Defined in: packages/sprotty/src/features/command-palette/command-palette.ts:192

Parameters

iconId

string

Returns

string


getOrCreateContainer()

protected getOrCreateContainer(baseDivId): HTMLElement

Defined in: packages/sprotty/src/base/ui-extensions/ui-extension.ts:89

Parameters

baseDivId

string

Returns

HTMLElement

Inherited from

AbstractUIExtension.getOrCreateContainer


hide()

hide(): void

Defined in: packages/sprotty/src/features/command-palette/command-palette.ts:216

Returns

void

Overrides

AbstractUIExtension.hide


hideIfEscapeEvent()

protected hideIfEscapeEvent(event): any

Defined in: packages/sprotty/src/features/command-palette/command-palette.ts:83

Parameters

event

KeyboardEvent

Returns

any


id()

id(): string

Defined in: packages/sprotty/src/features/command-palette/command-palette.ts:61

Returns

string

Overrides

AbstractUIExtension.id


initialize()

protected initialize(): boolean

Defined in: packages/sprotty/src/base/ui-extensions/ui-extension.ts:75

Returns

boolean

Inherited from

AbstractUIExtension.initialize


initializeContents()

protected initializeContents(containerElement): void

Defined in: packages/sprotty/src/features/command-palette/command-palette.ts:73

Initializes the contents of this UI extension.

Subclasses must implement this method to initialize the UI elements of this UI extension inside the specified containerElement.

Parameters

containerElement

HTMLElement

Returns

void

Overrides

AbstractUIExtension.initializeContents


onBeforeShow()

protected onBeforeShow(containerElement, root, …selectedElementIds): void

Defined in: packages/sprotty/src/features/command-palette/command-palette.ts:96

Updates the containerElement under the given context before it becomes visible.

Subclasses may override this method to, for instance, modifying the position of the containerElement, add or remove elements, etc. depending on the specified root or contextElementIds.

Parameters

containerElement

HTMLElement

root

Readonly<SModelRootImpl>

selectedElementIds

string[]

Returns

void

Overrides

AbstractUIExtension.onBeforeShow


onLoaded()

protected onLoaded(success): void

Defined in: packages/sprotty/src/features/command-palette/command-palette.ts:167

Parameters

success

"success" | "error"

Returns

void


onLoading()

protected onLoading(): void

Defined in: packages/sprotty/src/features/command-palette/command-palette.ts:158

Returns

void


onSelect()

protected onSelect(item): void

Defined in: packages/sprotty/src/features/command-palette/command-palette.ts:133

Parameters

item

LabeledAction

Returns

void


renderIcon()

protected renderIcon(itemElement, iconId): void

Defined in: packages/sprotty/src/features/command-palette/command-palette.ts:188

Parameters

itemElement

HTMLDivElement

iconId

string

Returns

void


renderLabeledActionSuggestion()

protected renderLabeledActionSuggestion(item, value): HTMLDivElement

Defined in: packages/sprotty/src/features/command-palette/command-palette.ts:173

Parameters

item

LabeledAction

value

string

Returns

HTMLDivElement


restoreFocus()

protected restoreFocus(): void

Defined in: packages/sprotty/src/base/ui-extensions/ui-extension.ts:68

Returns

void

Inherited from

AbstractUIExtension.restoreFocus


setContainerVisible()

protected setContainerVisible(visible): void

Defined in: packages/sprotty/src/base/ui-extensions/ui-extension.ts:99

Parameters

visible

boolean

Returns

void

Inherited from

AbstractUIExtension.setContainerVisible


show()

show(root, …contextElementIds): void

Defined in: packages/sprotty/src/features/command-palette/command-palette.ts:64

Parameters

root

Readonly<SModelRootImpl>

contextElementIds

string[]

Returns

void

Overrides

AbstractUIExtension.show


updateAutoCompleteActions()

protected updateAutoCompleteActions(update, text, root): void

Defined in: packages/sprotty/src/features/command-palette/command-palette.ts:138

Parameters

update

(items) => void

text

string

root

Readonly<SModelRootImpl>

Returns

void


isInvokePaletteKey()

readonly static isInvokePaletteKey(event): boolean

Defined in: packages/sprotty/src/features/command-palette/command-palette.ts:40

Parameters

event

KeyboardEvent

Returns

boolean