Show: Inherited Protected Private Deprecated

# ButtonLink Class

Uses:

- ButtonKeystroke
- ButtonStateClasses
- ButtonCfgProps

Defined in: `src/ui/react/src/components/buttons/button-link.jsx:4`

The ButtonLink class provides functionality for creating and editing a link in a document. ButtonLink renders in two different modes:

- Normal: Just a button that allows to switch to the edition mode
- Exclusive: The ButtonLinkEdit UI with all the link edition controls.

## Index

### Methods

- _requestExclusive
- componentWillMount
- componentWillUnmount
- getDefaultProps
- getStateClasses
- isActive
- mergeButtonCfgProps
- render

### Properties

- editor
- key static
- keystroke
- label
- tabIndex

## Methods

### `_requestExclusive`

() protected

Defined in `src/ui/react/src/components/buttons/button-link.jsx:106`

Requests the link button to be rendered in exclusive mode to allow the creation of a link.

### `componentWillMount`

()

Inherited from ButtonKeystroke: `src/ui/react/src/components/base/button-keystroke.js:24`

Lifecycle. Invoked once, both on the client and server, immediately before the initial rendering occurs.

### `componentWillUnmount`

()

Inherited from ButtonKeystroke: `src/ui/react/src/components/base/button-keystroke.js:59`

Lifecycle. Invoked immediately before a component is unmounted from the DOM.

### `getDefaultProps`

() Object

Defined in `src/ui/react/src/components/buttons/button-link.jsx:57`

Lifecycle. Returns the default values of the properties used in the widget.

#### Returns:

Object:

The default properties.

### `getStateClasses`

() String

Inherited from ButtonStateClasses: `src/ui/react/src/components/base/button-state-classes.js:15`

Returns the list of state classes associated to the current element's state, according to the results of the isActive and isDisabled methods.

#### Returns:

String:

A string with the state CSS classes.

### `isActive`

() Boolean

Defined in `src/ui/react/src/components/buttons/button-link.jsx:72`

Checks if the current selection is contained within a link.

#### Returns:

Boolean:

True if the selection is inside a link, false otherwise.

### `mergeButtonCfgProps`

(

- `props`

)
Object

Inherited from ButtonCfgProps: `src/ui/react/src/components/base/button-props.js:21`

Merges the properties, passed to the current component with user's configuration via `buttonCfg` property.

#### Parameters:

- `props` Object

  The properties to be merged with the provided configuration for this button. If not passed, the user configuration will be merged with `this.props`

#### Returns:

Object:

The merged properties

### `render`

() Object

Defined in `src/ui/react/src/components/buttons/button-link.jsx:82`

Lifecycle. Renders the UI of the button.

#### Returns:

Object:

The content which should be rendered.

## Properties

### `editor`

Object

Inherited from ButtonCfgProps but overwritten in `src/ui/react/src/components/buttons/button-link.jsx:22`

The editor instance where the component is being used.

### `key`

String static

Defined in `src/ui/react/src/components/buttons/button-link.jsx:47`

The name which will be used as an alias of the button in the configuration.

Default: link

### `keystroke`

Object

Inherited from ButtonKeystroke: `src/ui/react/src/components/base/button-keystroke.js:13`

The keystroke definition. An object with the following properties:

- fn: The function to be executed
- keys: The keystroke definition, as expected by http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-setKeystroke
- name: The name for the CKEditor command that will be created. If empty, a random name will be created on the fly

### `label`

String

Defined in `src/ui/react/src/components/buttons/button-link.jsx:29`

The label that should be used for accessibility purposes.

### `tabIndex`

Number

Defined in `src/ui/react/src/components/buttons/button-link.jsx:36`

The tabIndex of the button in its toolbar current state. A value other than -1 means that the button has focus and is the active element.