@Tag(value="vaadin-rich-text-editor") public class RichTextEditor extends GeneratedVaadinRichTextEditor<RichTextEditor,String> implements HasSize, HasValueChangeMode, InputNotifier, KeyNotifier, 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,?>>AbstractField.ComponentValueChangeEvent<C extends Component,V>HasValue.ValueChangeEvent<V>, HasValue.ValueChangeListener<E extends HasValue.ValueChangeEvent<?>>DEFAULT_CHANGE_TIMEOUT| Constructor and Description |
|---|
RichTextEditor()
Constructs an empty
RichTextEditor. |
RichTextEditor(HasValue.ValueChangeListener<? super 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,
HasValue.ValueChangeListener<? super AbstractField.ComponentValueChangeEvent<RichTextEditor,String>> listener)
Constructs an empty
RichTextEditor with a value change listener
and an initial value. |
| Modifier and Type | Method and Description |
|---|---|
HasValue<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.
|
ValueChangeMode |
getValueChangeMode()
Gets current value change mode of the component.
|
void |
setI18n(RichTextEditor.RichTextEditorI18n i18n)
Sets the internationalization properties for this component.
|
void |
setValue(String value)
Sets the value of this editor.
|
void |
setValueChangeMode(ValueChangeMode valueChangeMode)
Sets new value change mode for the component.
|
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, setWidthFullgetElementgetValueChangeTimeout, setValueChangeTimeoutaddInputListeneraddKeyDownListener, addKeyDownListener, addKeyPressListener, addKeyPressListener, addKeyUpListener, addKeyUpListeneraddCompositionEndListener, addCompositionStartListener, addCompositionUpdateListeneraddClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameaddThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeNameisReadOnly, isRequiredIndicatorVisible, setReadOnly, setRequiredIndicatorVisibleclear, getOptionalValueisEnabled, setEnabledaddAttachListeneraddDetachListenerpublic RichTextEditor()
RichTextEditor.public RichTextEditor(String initialValue)
RichTextEditor with the initial valueinitialValue - the initial value in Delta format, not nullAbstractField.setValue(Object)public RichTextEditor(HasValue.ValueChangeListener<? super 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, HasValue.ValueChangeListener<? super 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 ValueChangeMode getValueChangeMode()
The default value is ValueChangeMode.ON_CHANGE.
getValueChangeMode in interface HasValueChangeModenull if
the value is not synchronizedpublic void setValueChangeMode(ValueChangeMode valueChangeMode)
HasValueChangeModesetValueChangeMode in interface HasValueChangeModevalueChangeMode - new value change mode, or null to disable the value
synchronizationpublic 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 HasValue<AbstractField.ComponentValueChangeEvent<RichTextEditor,String>,String>setValue in class AbstractField<RichTextEditor,String>value - the new value in Delta format, not nullasHtml(),
AsHtml#setValue(String)public String getValue()
getValue in interface HasValue<AbstractField.ComponentValueChangeEvent<RichTextEditor,String>,String>getValue in class 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()public HasValue<HasValue.ValueChangeEvent<String>,String> asHtml()
HasValue for binding the html value of the
editor with Binder.HasValueCopyright © 2025. All rights reserved.