@Tag(value="vaadin-rich-text-editor") @NpmPackage(value="@vaadin/vaadin-rich-text-editor", version="1.3.2") @JsModule(value="@vaadin/vaadin-rich-text-editor/src/vaadin-rich-text-editor.js") @HtmlImport(value="frontend://bower_components/vaadin-rich-text-editor/src/vaadin-rich-text-editor.html") public abstract class GeneratedVaadinRichTextEditor<R extends GeneratedVaadinRichTextEditor<R,T>,T> extends AbstractSinglePropertyField<R,T> implements HasStyle, HasTheme
Description copied from corresponding location in WebComponent:
<vaadin-rich-text-editor>
is a Web Component for rich text editing.
It provides a set of toolbar controls to apply formatting on the content,
which is stored and can be accessed as HTML5 or JSON string.
<vaadin-rich-text-editor></vaadin-rich-text-editor>
Vaadin Rich Text Editor focuses on the structure, not the styling of content. Therefore, the semantic HTML5 tags and CSS usage is limited to most common cases, like horizontal text alignment.
The following state attributes are available for styling:
Attribute | Description | Part name |
---|---|---|
disabled |
Set to a disabled text editor | :host |
readonly |
Set to a readonly text editor | :host |
The following shadow DOM parts are available for styling:
Part name | Description |
---|---|
toolbar |
The toolbar wrapper |
content |
The content wrapper |
group |
The group for toolbar controls |
undo-button |
The "undo" button |
redo-button |
The "redo" button |
bold-button |
The "bold" button |
italic-button |
The "italic" button |
underline-button |
The "underline" button |
strike-button |
The "strike-through" button |
h1-button |
The "header 1" button |
h2-button |
The "header 2" button |
h3-button |
The "header 3" button |
subscript-button |
The "subscript" button |
superscript-button |
The "superscript" button |
list-ordered-button |
The "ordered list" button |
list-bullet-button |
The "bullet list" button |
align-left-button |
The "left align" button |
align-center-button |
The "center align" button |
align-right-button |
The "right align" button |
image-button |
The "image" button |
blockquote-button |
The "blockquote" button |
code-block-button |
The "code block" button |
clean-button |
The "clean formatting" button |
Modifier and Type | Class and Description |
---|---|
static class |
GeneratedVaadinRichTextEditor.ChangeEvent<R extends GeneratedVaadinRichTextEditor<R,?>> |
AbstractField.ComponentValueChangeEvent<C extends Component,V>
HasValue.ValueChangeEvent<V>, HasValue.ValueChangeListener<E extends HasValue.ValueChangeEvent<?>>
Constructor and Description |
---|
GeneratedVaadinRichTextEditor()
Default constructor.
|
GeneratedVaadinRichTextEditor(T initialValue,
T defaultValue,
boolean acceptNullValues)
Constructs a new GeneratedVaadinRichTextEditor component with the given
arguments.
|
GeneratedVaadinRichTextEditor(T initialValue,
T defaultValue,
Class<P> elementPropertyType,
SerializableBiFunction<R,P,T> presentationToModel,
SerializableBiFunction<R,T,P> modelToPresentation)
Constructs a new GeneratedVaadinRichTextEditor component with the given
arguments.
|
GeneratedVaadinRichTextEditor(T initialValue,
T defaultValue,
Class<P> elementPropertyType,
SerializableFunction<P,T> presentationToModel,
SerializableFunction<T,P> modelToPresentation)
Constructs a new GeneratedVaadinRichTextEditor component with the given
arguments.
|
Modifier and Type | Method and Description |
---|---|
protected Registration |
addChangeListener(ComponentEventListener<GeneratedVaadinRichTextEditor.ChangeEvent<R>> listener)
Adds a listener for
change events fired by the webcomponent. |
void |
addThemeVariants(RichTextEditorVariant... variants)
Adds theme variants to the component.
|
protected String |
getHtmlValueString()
Description copied from corresponding location in WebComponent:
|
protected elemental.json.JsonArray |
getI18nJsonArray()
Description copied from corresponding location in WebComponent:
|
protected boolean |
isDisabledBoolean()
Description copied from corresponding location in WebComponent:
|
protected boolean |
isReadonlyBoolean()
Description copied from corresponding location in WebComponent:
|
void |
removeThemeVariants(RichTextEditorVariant... variants)
Removes theme variants from the component.
|
protected void |
setDisabled(boolean disabled)
Description copied from corresponding location in WebComponent:
|
protected void |
setI18n(elemental.json.JsonArray i18n)
Description copied from corresponding location in WebComponent:
|
protected void |
setReadonly(boolean readonly)
Description copied from corresponding location in WebComponent:
|
getSynchronizationRegistration, hasValidValue, setPresentationValue, setSynchronizedEvent
addValueChangeListener, getEmptyValue, getValue, isEmpty, setModelValue, setValue, valueEquals
addListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, set, setElement, setId, setVisible
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeName
getElement
isReadOnly, isRequiredIndicatorVisible, setReadOnly, setRequiredIndicatorVisible
clear, getOptionalValue
isEnabled, setEnabled
addAttachListener
addDetachListener
public GeneratedVaadinRichTextEditor(T initialValue, T defaultValue, Class<P> elementPropertyType, SerializableFunction<P,T> presentationToModel, SerializableFunction<T,P> modelToPresentation)
P
- the property typeinitialValue
- the initial value to set to the valuedefaultValue
- the default value to use if the value isn't definedelementPropertyType
- the type of the element propertypresentationToModel
- a function that converts a string value to a model valuemodelToPresentation
- a function that converts a model value to a string valuepublic GeneratedVaadinRichTextEditor(T initialValue, T defaultValue, boolean acceptNullValues)
initialValue
- the initial value to set to the valuedefaultValue
- the default value to use if the value isn't definedacceptNullValues
- whether null
is accepted as a model valuepublic GeneratedVaadinRichTextEditor(T initialValue, T defaultValue, Class<P> elementPropertyType, SerializableBiFunction<R,P,T> presentationToModel, SerializableBiFunction<R,T,P> modelToPresentation)
P
- the property typeinitialValue
- the initial value to set to the valuedefaultValue
- the default value to use if the value isn't definedelementPropertyType
- the type of the element propertypresentationToModel
- a function that accepts this component and a property value
and returns a model valuemodelToPresentation
- a function that accepts this component and a model value and
returns a property valuepublic GeneratedVaadinRichTextEditor()
public void addThemeVariants(RichTextEditorVariant... variants)
variants
- theme variants to addpublic void removeThemeVariants(RichTextEditorVariant... variants)
variants
- theme variants to remove@Synchronize(property="htmlValue", value="html-value-changed") protected String getHtmlValueString()
Description copied from corresponding location in WebComponent:
HTML representation of the rich text editor content.
This property is synchronized automatically from client side when a 'html-value-changed' event happens.
htmlValue
property from the webcomponentprotected boolean isDisabledBoolean()
Description copied from corresponding location in WebComponent:
When true, the user can not modify, nor copy the editor content.
This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.
disabled
property from the webcomponentprotected void setDisabled(boolean disabled)
Description copied from corresponding location in WebComponent:
When true, the user can not modify, nor copy the editor content.
disabled
- the boolean value to setprotected boolean isReadonlyBoolean()
Description copied from corresponding location in WebComponent:
When true, the user can not modify the editor content, but can copy it.
This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.
readonly
property from the webcomponentprotected void setReadonly(boolean readonly)
Description copied from corresponding location in WebComponent:
When true, the user can not modify the editor content, but can copy it.
readonly
- the boolean value to setprotected elemental.json.JsonArray getI18nJsonArray()
Description copied from corresponding location in WebComponent:
An object used to localize this component. The properties are used e.g. as the tooltips for the editor toolbar buttons.
This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.
i18n
property from the webcomponentprotected void setI18n(elemental.json.JsonArray i18n)
Description copied from corresponding location in WebComponent:
An object used to localize this component. The properties are used e.g. as the tooltips for the editor toolbar buttons.
i18n
- the JsonArray value to setprotected Registration addChangeListener(ComponentEventListener<GeneratedVaadinRichTextEditor.ChangeEvent<R>> listener)
change
events fired by the webcomponent.listener
- the listenerRegistration
for removing the event listenerCopyright © 2023. All rights reserved.