# Class: Editor

## RichFaces.ui. Editor

#### new Editor(componentId, options, config)

Backing object for rich:editor

##### Parameters:

Name | Type | Description
--- | --- | ---
`componentId` | string | component id
`options` | object | editor options
`config` | object | CKeditor configuration

Source:
  - editor.js, line 36

### Extends

- RichFaces.BaseComponent

### Members

#### name :string

Component name.

##### Type:

- string

Inherited From:
  - RichFaces.BaseComponent#name
Source:
  - richfaces-base-component.js, line 195

### Methods

#### (static) getValue() → {string}

Get current value

Source:
  - editor.js, line 247

##### Returns:

current value

Type
  string

#### attachToDom(source) → {DOMElement}

Attach component object to DOM element by component id, DOM element or jQuery object and returns the element Its required for the client side API calls and to clean up after ajax request or document unload by calling destroy method

##### Parameters:

Name | Type | Description
--- | --- | ---
`source` | string | DOMElement | jQuery | component id, DOM element or DOM elements wrapped by jQuery

Inherited From:
  - RichFaces.BaseComponent#attachToDom
Source:
  - richfaces-base-component.js, line 237

##### Returns:

Type
  DOMElement

#### blur()

Remove focus from this component

Source:
  - editor.js, line 272

#### destroy()

Destroy method. Will be called before remove component from the page

Inherited From:
  - RichFaces.BaseComponent#destroy
Source:
  - richfaces-base-component.js, line 313

#### detach(source)

Detach component object from DOM element by component id, DOM element or jQuery object

##### Parameters:

Name | Type | Description
--- | --- | ---
`source` | string | DOMElement | jQuery | component id, DOM element or DOM elements wrapped by jQuery

Inherited From:
  - RichFaces.BaseComponent#detach
Source:
  - richfaces-base-component.js, line 258

#### focus()

Set focus to this component

Source:
  - editor.js, line 262

#### focus() → {boolean}

Returns true if the component is in editing state

Source:
  - inplaceBase.js, line 124

##### Returns:

true if the component is in editing state

Type
  boolean

#### getEditor() → {CKEDITOR}

Get the CKEditor object instance

Source:
  - editor.js, line 221

##### Returns:

CKEditor instance

Type
  CKEDITOR

#### getEventElement() → {string}

Method returns element's id for event handlers binding. Event API calls this method when binding by component object as selector was used.

Inherited From:
  - RichFaces.BaseComponent#getEventElement
Source:
  - richfaces-base-component.js, line 224

##### Returns:

Type
  string

#### invokeEvent(eventType, element, event, data) → {boolean}

Invokes event on on the DOM element

##### Parameters:

Name | Type | Description
--- | --- | ---
`eventType` | string | event type, e.g. "click"
`element` | DOMElement | DOM element object
`event` | Event | jQuery Event
`data` | Object | additional data used for event handler

Inherited From:
  - RichFaces.BaseComponent#invokeEvent
Source:
  - richfaces-base-component.js, line 272

##### Returns:

true if an event is successfully invoked

Type
  boolean

#### isDirty() → {boolean}

Returns true if the editor is in a dirty state, i.e. edited since last receiving focus

Source:
  - editor.js, line 293

##### Returns:

true if the editor is in a dirty state

Type
  boolean

#### isFocused() → {boolean}

Returns true if the component is focused

Source:
  - editor.js, line 282

##### Returns:

true if the editor is focused

Type
  boolean

#### isReadOnly() → {boolean}

Returns true if the editor is read-only

Source:
  - editor.js, line 326

##### Returns:

true if the editor is read-only

Type
  boolean

#### isValueChanged() → {boolean}

Returns true of the value has changed from default

Source:
  - editor.js, line 304

##### Returns:

true if the value is changed

Type
  boolean

#### setReadOnly(readOnly)

Set the readonly state

##### Parameters:

Name | Type | Description
--- | --- | ---
`readOnly` | boolean | the new state

Source:
  - editor.js, line 315

#### setValue(value)

Set value

##### Parameters:

Name | Type | Description
--- | --- | ---
`value` | string | new value

Source:
  - editor.js, line 232

#### toString() → {string}

Method for converting object to string

Inherited From:
  - RichFaces.BaseComponent#toString
Source:
  - richfaces-base-component.js, line 203

##### Returns:

Type
  string