@Tag(value="vaadin-rich-text-editor") public class RichTextEditor extends GeneratedVaadinRichTextEditor<RichTextEditor,String> implements com.vaadin.flow.component.HasSize, com.vaadin.flow.data.value.HasValueChangeMode, com.vaadin.flow.component.InputNotifier, com.vaadin.flow.component.KeyNotifier, com.vaadin.flow.component.CompositionNotifier
<vaadin-rich-text-editor> component.
The value of the rich text editor is in
Delta format. The
setValue and getValue methods
deal with the default Delta format, but it is also possible to get and set
the value as an HTML string using
rte.,
asHtml().getValue()rte.
and asHtml().setValue()getHtmlValue().
| Modifier and Type | Class and Description |
|---|---|
static class |
RichTextEditor.RichTextEditorI18n
The internationalization properties for
RichTextEditor. |
GeneratedVaadinRichTextEditor.ChangeEvent<R extends GeneratedVaadinRichTextEditor<R,?>>| Constructor and Description |
|---|
RichTextEditor()
Constructs an empty
RichTextEditor. |
RichTextEditor(com.vaadin.flow.component.HasValue.ValueChangeListener<? super com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<RichTextEditor,String>> listener)
Constructs an empty
RichTextEditor with a value change listener. |
RichTextEditor(String initialValue)
Constructs a
RichTextEditor with the initial value |
RichTextEditor(String initialValue,
com.vaadin.flow.component.HasValue.ValueChangeListener<? super com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<RichTextEditor,String>> listener)
Constructs an empty
RichTextEditor with a value change listener
and an initial value. |
| Modifier and Type | Method and Description |
|---|---|
com.vaadin.flow.component.HasValue<com.vaadin.flow.component.HasValue.ValueChangeEvent<String>,String> |
asHtml()
Gets an instance of
HasValue for binding the html value of the
editor with Binder. |
String |
getHtmlValue()
The value of the editor presented as an HTML string.
|
RichTextEditor.RichTextEditorI18n |
getI18n()
Gets the internationalization object previously set for this component.
|
String |
getValue()
Returns the current value of the text editor in
Delta format.
|
com.vaadin.flow.data.value.ValueChangeMode |
getValueChangeMode() |
void |
setI18n(RichTextEditor.RichTextEditorI18n i18n)
Sets the internationalization properties for this component.
|
void |
setValue(String value)
Sets the value of this editor.
|
void |
setValueChangeMode(com.vaadin.flow.data.value.ValueChangeMode valueChangeMode) |
addChangeListener, addThemeVariants, getHtmlValueString, getI18nJsonArray, isDisabledBoolean, isReadonlyBoolean, removeThemeVariants, setDisabled, setI18n, setReadonlygetSynchronizationRegistration, hasValidValue, setPresentationValue, setSynchronizedEventaddValueChangeListener, getEmptyValue, isEmpty, setModelValue, valueEqualsaddListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, set, setElement, setId, setVisibleclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCssSize, getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFullgetValueChangeTimeout, setValueChangeTimeoutaddKeyDownListener, addKeyDownListener, addKeyPressListener, addKeyPressListener, addKeyUpListener, addKeyUpListeneraddCompositionEndListener, addCompositionStartListener, addCompositionUpdateListeneraddClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameaddThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeNamepublic RichTextEditor()
RichTextEditor.public RichTextEditor(String initialValue)
RichTextEditor with the initial valueinitialValue - the initial value in Delta format, not nullAbstractField.setValue(Object)public RichTextEditor(com.vaadin.flow.component.HasValue.ValueChangeListener<? super com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<RichTextEditor,String>> listener)
RichTextEditor with a value change listener.listener - the value change listenerAbstractField.addValueChangeListener(com.vaadin.flow.component.HasValue.ValueChangeListener)public RichTextEditor(String initialValue, com.vaadin.flow.component.HasValue.ValueChangeListener<? super com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<RichTextEditor,String>> listener)
RichTextEditor with a value change listener
and an initial value.initialValue - the initial valuelistener - the value change listenerAbstractField.setValue(Object),
AbstractField.addValueChangeListener(com.vaadin.flow.component.HasValue.ValueChangeListener)public RichTextEditor.RichTextEditorI18n getI18n()
Note: updating the object content that is gotten from this method will
not update the lang on the component if not set back using
setI18n(RichTextEditorI18n)
null, If the i18n
properties weren't set.public void setI18n(RichTextEditor.RichTextEditorI18n i18n)
i18n - the internationalized properties, not nullpublic com.vaadin.flow.data.value.ValueChangeMode getValueChangeMode()
The default value is ValueChangeMode.ON_CHANGE.
getValueChangeMode in interface com.vaadin.flow.data.value.HasValueChangeModepublic void setValueChangeMode(com.vaadin.flow.data.value.ValueChangeMode valueChangeMode)
setValueChangeMode in interface com.vaadin.flow.data.value.HasValueChangeModepublic void setValue(String value)
getValue(), fires a value change event.
Throws NullPointerException, if the value is null.
Note: Binder will take care of the null conversion when
integrates with the editor, as long as no new converter is defined.
setValue in interface com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<RichTextEditor,String>,String>setValue in class com.vaadin.flow.component.AbstractField<RichTextEditor,String>value - the new value in Delta format, not nullasHtml(),
AsHtml#setValue(String)public String getValue()
getValue in interface com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<RichTextEditor,String>,String>getValue in class com.vaadin.flow.component.AbstractField<RichTextEditor,String>getHtmlValue(),
asHtml(),
AsHtml#getValue()public String getHtmlValue()
This represents the value currently set on the client side. If you have
just set the value on the server side using setValue(String) or
AsHtml#setValue(String) then the value returned from this method
will not yet correspond to the newly set value until the next server
round trip.
htmlValue property from the web component
or null if it is not available.getValue(),
asHtml(),
AsHtml#getValue()Copyright © 2025. All rights reserved.