1. Domino UI
  2. Components
  3. Rich text editor
Top Basic Docs

Rich text editor

A Rich Text Editor component that provides a user-friendly interface for editing and formatting text content, including commands for text manipulation and styling.

Usage Example:


 RichTextEditor editor = RichTextEditor.create();
 editor.setValue("Sample text");
 

See also :

Examples

Basic alerts Simple alerts with custom look and feel.

API Docs: RichTextEditor

Constructors

public void RichTextEditor(RichTextActionsGroup[] actions)
Constructs a new RichTextEditor with default configuration and commands.

actions

A list of actions to be added to the editor toolbars.

public void RichTextEditor()
Constructs a new RichTextEditor with default configuration and commands.
public void RichTextEditor(Collection<RichTextActionsGroup> actions)
Constructs a new RichTextEditor with default configuration and commands.

actions

A list of actions to be added to the editor toolbars.

Static methods

public static RichTextEditor create()
Factory method to create a new instance of RichTextEditor .

Returns:

a new instance of RichTextEditor

public static RichTextEditor create(RichTextActionsGroup[] actions)
Factory method to create a new instance of RichTextEditor .

actions

A list of actions to be added to the editor toolbars.



Returns:

a new instance of RichTextEditor

public static RichTextEditor create(Collection<RichTextActionsGroup> actions)
Factory method to create a new instance of RichTextEditor .

actions

A list of actions to be added to the editor toolbars.



Returns:

a new instance of RichTextEditor

Public methods

public RichTextEditor withValue(String value)
Sets the value of the rich text editor and returns the editor instance for chaining.

This is a convenient method that internally calls setValue

value

The text value to be set in the editor.



Returns:

The current RichTextEditor instance for chaining.

public RichTextEditor withValue(String value, boolean silent)
Sets the value of the rich text editor with an option to remain silent and returns the editor instance for chaining.

This method internally calls setValue . The silent parameter is currently not being used, and its functionality might be implemented in future versions.

value

The text value to be set in the editor.

silent

A flag to indicate if the operation should remain silent (currently not being used).



Returns:

The current RichTextEditor instance for chaining.

public void setValue(String s)
Sets the content inside the rich text editor.

The provided string is treated as HTML, and it's safely injected into the editor's content area.

s

The HTML content to be set in the editor.

public String getValue()
Retrieves the current content of the rich text editor treated as HTML.

Returns:

The editor's current content as an HTML string.

public RichTextEditor withEditableElement(ChildHandler<RichTextEditor, DivElement> handler)
Customizes the editable element of the RichTextEditor.

handler

The handler to apply customizations.



Returns:

The current instance for chaining.

public RichTextEditor withToolbars(ChildHandler<RichTextEditor, DivElement> handler)
Customizes the toolbars of the RichTextEditor.

handler

The handler to apply customizations.



Returns:

The current instance for chaining.

We are a group of passionate people who love what we do

Donate & Support Us