com.vaadin.flow.component.richtexteditor.
Class GeneratedVaadinRichTextEditor<R extends GeneratedVaadinRichTextEditor<R,T>,T>
- java.lang.Object
-
- com.vaadin.flow.component.Component
-
- com.vaadin.flow.component.AbstractField<C,T>
-
- com.vaadin.flow.component.AbstractSinglePropertyField<R,T>
-
- com.vaadin.flow.component.richtexteditor.GeneratedVaadinRichTextEditor<R,T>
-
All Implemented Interfaces:
AttachNotifier
,DetachNotifier
,HasElement
,HasEnabled
,HasStyle
,HasTheme
,HasValue<AbstractField.ComponentValueChangeEvent<R,T>,T>
,HasValueAndElement<AbstractField.ComponentValueChangeEvent<R,T>,T>
,Serializable
Direct Known Subclasses:
@Tag("vaadin-rich-text-editor") @NpmPackage(value="@vaadin/polymer-legacy-adapter",version="23.1.15") @NpmPackage(value="@vaadin/rich-text-editor",version="23.1.15") @NpmPackage(value="@vaadin/vaadin-rich-text-editor",version="23.1.15") @JsModule("@vaadin/polymer-legacy-adapter/style-modules.js") @JsModule("@vaadin/rich-text-editor/src/vaadin-rich-text-editor.js") 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.
Styling
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 Styling 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 Shadow parts See ThemableMixin ? how to apply styles for shadow parts
See Also:
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GeneratedVaadinRichTextEditor.ChangeEvent<R extends GeneratedVaadinRichTextEditor<R,?>>
-
Nested classes/interfaces inherited from class com.vaadin.flow.component.AbstractField
AbstractField.ComponentValueChangeEvent<C extends Component,V>
-
Nested classes/interfaces inherited from interface com.vaadin.flow.component.HasValue
HasValue.ValueChangeEvent<V>, HasValue.ValueChangeListener<E extends HasValue.ValueChangeEvent<?>>
-
-
Constructor Summary
Constructors Constructor Description GeneratedVaadinRichTextEditor()
Default constructor.
GeneratedVaadinRichTextEditor(T initialValue, T defaultValue, boolean acceptNullValues, boolean isInitialValueOptional)
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.
-
Method Summary
All Methods Modifier and Type Method 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:
-
Methods inherited from class com.vaadin.flow.component.AbstractSinglePropertyField
getSynchronizationRegistration, hasValidValue, setPresentationValue, setSynchronizedEvent
-
Methods inherited from class com.vaadin.flow.component.AbstractField
addValueChangeListener, getEmptyValue, getValue, isEmpty, setModelValue, setValue, valueEquals
-
Methods inherited from class com.vaadin.flow.component.Component
addListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, scrollIntoView, set, setElement, setId, setVisible
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListener
-
Methods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListener
-
Methods inherited from interface com.vaadin.flow.component.HasElement
getElement
-
Methods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabled
-
Methods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Methods inherited from interface com.vaadin.flow.component.HasTheme
addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeName
-
Methods inherited from interface com.vaadin.flow.component.HasValue
clear, getOptionalValue
-
Methods inherited from interface com.vaadin.flow.component.HasValueAndElement
isReadOnly, isRequiredIndicatorVisible, setReadOnly, setRequiredIndicatorVisible
-
-
-
-
Constructor Detail
-
GeneratedVaadinRichTextEditor
public 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.
Type Parameters:
P
- the property typeParameters:
initialValue
- 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 value
-
GeneratedVaadinRichTextEditor
public GeneratedVaadinRichTextEditor(T initialValue, T defaultValue, boolean acceptNullValues, boolean isInitialValueOptional)
Constructs a new GeneratedVaadinRichTextEditor component with the given arguments.
Parameters:
initialValue
- the initial value to set to the valuedefaultValue
- the default value to use if the value isn't definedacceptNullValues
- whethernull
is accepted as a model valueisInitialValueOptional
- ifisInitialValueOptional
istrue
then the initial value is used only if element has no"value"
property value, otherwise element"value"
property is ignored and the initial value is set
-
GeneratedVaadinRichTextEditor
public 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.
Type Parameters:
P
- the property typeParameters:
initialValue
- 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 value
-
GeneratedVaadinRichTextEditor
public GeneratedVaadinRichTextEditor()
Default constructor.
-
-
Method Detail
-
addThemeVariants
public void addThemeVariants(RichTextEditorVariant... variants)
Adds theme variants to the component.
Parameters:
variants
- theme variants to add
-
removeThemeVariants
public void removeThemeVariants(RichTextEditorVariant... variants)
Removes theme variants from the component.
Parameters:
variants
- theme variants to remove
-
getHtmlValueString
@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.
Returns:
the
htmlValue
property from the webcomponent
-
isDisabledBoolean
protected 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.
Returns:
the
disabled
property from the webcomponent
-
setDisabled
protected void setDisabled(boolean disabled)
Description copied from corresponding location in WebComponent:
When true, the user can not modify, nor copy the editor content.
Parameters:
disabled
- the boolean value to set
-
isReadonlyBoolean
protected 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.
Returns:
the
readonly
property from the webcomponent
-
setReadonly
protected 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.
Parameters:
readonly
- the boolean value to set
-
getI18nJsonArray
protected 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.
Returns:
the
i18n
property from the webcomponent
-
setI18n
protected 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.
Parameters:
i18n
- the JsonArray value to set
-
addChangeListener
protected Registration addChangeListener(ComponentEventListener<GeneratedVaadinRichTextEditor.ChangeEvent<R>> listener)
Adds a listener for
change
events fired by the webcomponent.Parameters:
listener
- the listenerReturns:
a
Registration
for removing the event listener
-
-