Richtexteditor Ui - LinkCommandBuilder
30 Sep 20263 minutes to read
Builder for link command with chainable URL/text options.
Owns the link-command payload assembly and dispatch. The internal link module
simply produces the building blocks (operation, href, displayText, target,
title) and delegates the final mutation through this builder so all
link-related actions route through one entry point.
Methods
apply
Execute the link command and dispatch through the action pipeline.
Returns void
displayText
Set the display text of the link. Alias for text().
| Parameter | Type | Description |
|---|---|---|
| displayValue | string |
The display text value to set |
Returns this
href
Set the href for the link.
| Parameter | Type | Description |
|---|---|---|
| hrefValue | string |
The href value to set |
Returns this
operation
Set the link operation mode.
Default is 'insert'. Pass 'edit' to update an existing link,
'remove' to unlink a selection, and 'open' / 'copy' for the
matching Quick Toolbar actions.
Returns this
source
Capture the originating event so the action pipeline can forward it
through EditorController.process. Optional for callers that only
need a fire-and-forget mutation (e.g. executeCommand('link', ...)).
| Parameter | Type | Description |
|---|---|---|
| event |
MouseEvent | KeyboardEvent
|
The source event |
Returns this
target
Set the target attribute (e.g. '_blank', '_self').
| Parameter | Type | Description |
|---|---|---|
| targetValue |
string | null
|
The target attribute value to set |
Returns this
text
Set the visible text of the link.
| Parameter | Type | Description |
|---|---|---|
| textValue | string |
The text value to set |
Returns this
title
Set the title/tooltip attribute of the link.
| Parameter | Type | Description |
|---|---|---|
| titleValue |
string | null
|
The title value to set |
Returns this
url
Set the URL/href for the link. Alias for href() to match the
public API expected from dialog consumers.
| Parameter | Type | Description |
|---|---|---|
| urlValue | string |
The URL value to set |
Returns this