Displays a command tooltip above the currently active line selection, with clickable elements.
Internally it is a composite of two tooltips, one for the main tooltip and one for the
overflowing commands.
The commands are added sequentially in registration order.
When attached to an editor, it is either always shown or only when the active line is hovered
with mouse, depending on the alwaysShow property.
Attaches the clickable command bar tooltip to an editor
Depending on the alwaysShow parameter it either displays the tooltip immediately,
or subscribes to the necessary events to display the tooltip on hover.
Parameters
editor: Editor
Returns void
destroy
destroy(): void
Returns void
detach
detach(): void
Detaches the tooltip from the editor.
Returns void
getAlwaysShow
getAlwaysShow(): boolean
Returns boolean
isMoreOptionsShown
isMoreOptionsShown(): boolean
Returns boolean
isShown
isShown(): boolean
Returns boolean
registerCommand
registerCommand(id, command): void
Registers a command on the command bar tooltip.
The commands are added in sequential order. If there is not enough space on the main
toolbar, the remaining elements are added to the overflow menu.
Parameters
id: string
command: TooltipCommand
Returns void
setAlwaysShow
setAlwaysShow(alwaysShow): void
Sets the display mode of the tooltip
When true, the tooltip is always displayed while it is attached to an editor.
When false, the tooltip is displayed only when the mouse hovers over the active editor line.
Parameters
alwaysShow: boolean
Returns void
update
update(): void
Updates each command element in the tooltip.
This is automatically called on certain events, but can be called manually as well.
Returns void
updatePosition
updatePosition(): void
Updates the position of the command bar tooltip. It aligns itself above the active line in the editor.
Displays a command tooltip above the currently active line selection, with clickable elements.
Internally it is a composite of two tooltips, one for the main tooltip and one for the overflowing commands. The commands are added sequentially in registration order. When attached to an editor, it is either always shown or only when the active line is hovered with mouse, depending on the alwaysShow property.