Klasse GeneratedEnhancedRichTextEditor<R extends GeneratedEnhancedRichTextEditor<R,T>,T>

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.AbstractField<R,T>
com.vaadin.flow.component.AbstractSinglePropertyField<R,T>
com.vaadin.componentfactory.GeneratedEnhancedRichTextEditor<R,T>
Alle implementierten Schnittstellen:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.BlurNotifier<GeneratedEnhancedRichTextEditor<R,T>>, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.Focusable<GeneratedEnhancedRichTextEditor<R,T>>, com.vaadin.flow.component.FocusNotifier<GeneratedEnhancedRichTextEditor<R,T>>, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasEnabled, com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.HasTheme, com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<R,T>,T>, com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<R,T>,T>, Serializable
Bekannte direkte Unterklassen:
EnhancedRichTextEditor

@Tag("vcf-enhanced-rich-text-editor") @JsModule("./src/vcf-enhanced-rich-text-editor.js") public abstract class GeneratedEnhancedRichTextEditor<R extends GeneratedEnhancedRichTextEditor<R,T>,T> extends com.vaadin.flow.component.AbstractSinglePropertyField<R,T> implements com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.HasTheme, com.vaadin.flow.component.Focusable<GeneratedEnhancedRichTextEditor<R,T>>

Description copied from corresponding location in WebComponent:

<vcf-enhanced-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.

<vcf-enhanced-rich-text-editor></vcf-enhanced-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
readonly-button The "readonly" button
clean-button The "clean formatting" button
Shadow parts

See ThemableMixin – how to apply styles for shadow parts

Siehe auch:
  • Konstruktordetails

    • GeneratedEnhancedRichTextEditor

      public GeneratedEnhancedRichTextEditor(T initialValue, T defaultValue, Class<P> elementPropertyType, com.vaadin.flow.function.SerializableFunction<P,T> presentationToModel, com.vaadin.flow.function.SerializableFunction<T,P> modelToPresentation)
      Constructs a new GeneratedEnhancedRichTextEditor component with the given arguments.
      Typparameter:
      P - the property type
      Parameter:
      initialValue - the initial value to set to the value
      defaultValue - the default value to use if the value isn't defined
      elementPropertyType - the type of the element property
      presentationToModel - a function that converts a string value to a model value
      modelToPresentation - a function that converts a model value to a string value
    • GeneratedEnhancedRichTextEditor

      public GeneratedEnhancedRichTextEditor(T initialValue, T defaultValue, boolean acceptNullValues)
      Constructs a new GeneratedEnhancedRichTextEditor component with the given arguments.
      Parameter:
      initialValue - the initial value to set to the value
      defaultValue - the default value to use if the value isn't defined
      acceptNullValues - whether null is accepted as a model value
    • GeneratedEnhancedRichTextEditor

      public GeneratedEnhancedRichTextEditor(T initialValue, T defaultValue, Class<P> elementPropertyType, com.vaadin.flow.function.SerializableBiFunction<R,P,T> presentationToModel, com.vaadin.flow.function.SerializableBiFunction<R,T,P> modelToPresentation)
      Constructs a new GeneratedEnhancedRichTextEditor component with the given arguments.
      Typparameter:
      P - the property type
      Parameter:
      initialValue - the initial value to set to the value
      defaultValue - the default value to use if the value isn't defined
      elementPropertyType - the type of the element property
      presentationToModel - a function that accepts this component and a property value and returns a model value
      modelToPresentation - a function that accepts this component and a model value and returns a property value
    • GeneratedEnhancedRichTextEditor

      public GeneratedEnhancedRichTextEditor()
      Default constructor.
  • Methodendetails

    • addThemeVariants

      public void addThemeVariants(EnhancedRichTextEditorVariant... variants)
      Adds theme variants to the component.
      Parameter:
      variants - theme variants to add
    • removeThemeVariants

      public void removeThemeVariants(EnhancedRichTextEditorVariant... variants)
      Removes theme variants from the component.
      Parameter:
      variants - theme variants to remove
    • setTabStops

      public void setTabStops(List<TabStop> tabStops)
    • getTabStops

      @Synchronize(property="tabStops", value="tab-stops-changed") public List<TabStop> getTabStops()
    • 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.

      Gibt zurück:
      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.

      Gibt zurück:
      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.

      Parameter:
      disabled - the boolean value to set
    • setNoRulers

      public void setNoRulers(boolean noRulers)

      Description copied from corresponding location in WebComponent:

      When true, the horizontal and vertical rulers are not visible.

      Parameter:
      noRulers - 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.

      Gibt zurück:
      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.

      Parameter:
      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.

      Gibt zurück:
      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.

      Parameter:
      i18n - the JsonArray value to set
    • addChangeListener

      protected com.vaadin.flow.shared.Registration addChangeListener(com.vaadin.flow.component.ComponentEventListener<GeneratedEnhancedRichTextEditor.ChangeEvent<R>> listener)
      Adds a listener for change events fired by the webcomponent.
      Parameter:
      listener - the listener
      Gibt zurück:
      a Registration for removing the event listener
    • addPlaceholderBeforeRemoveListener

      protected com.vaadin.flow.shared.Registration addPlaceholderBeforeRemoveListener(com.vaadin.flow.component.ComponentEventListener<GeneratedEnhancedRichTextEditor.PlaceholderBeforeRemoveEvent<R>> listener)
      Adds a listener for PlaceholderBeforeRemoveEvent events fired by the webcomponent.
      Parameter:
      listener - the listener
      Gibt zurück:
      a Registration for removing the event listener
    • addPlaceholderBeforeInsertListener

      protected com.vaadin.flow.shared.Registration addPlaceholderBeforeInsertListener(com.vaadin.flow.component.ComponentEventListener<GeneratedEnhancedRichTextEditor.PlaceholderBeforeInsertEvent<R>> listener)
      Adds a listener for PlaceholderBeforeInsertEvent events fired by the webcomponent.
      Parameter:
      listener - the listener
      Gibt zurück:
      a Registration for removing the event listener
    • addPlaceholderRemovedListener

      protected com.vaadin.flow.shared.Registration addPlaceholderRemovedListener(com.vaadin.flow.component.ComponentEventListener<GeneratedEnhancedRichTextEditor.PlaceholderRemovedEvent<R>> listener)
      Adds a listener for PlaceholderRemovedEvent events fired by the webcomponent.
      Parameter:
      listener - the listener
      Gibt zurück:
      a Registration for removing the event listener
    • addPlaceholderButtonClickedListener

      protected com.vaadin.flow.shared.Registration addPlaceholderButtonClickedListener(com.vaadin.flow.component.ComponentEventListener<GeneratedEnhancedRichTextEditor.PlaceholderButtonClickedEvent<R>> listener)
      Adds a listener for PlaceholderButtonClickedEvent events fired by the webcomponent.
      Parameter:
      listener - the listener
      Gibt zurück:
      a Registration for removing the event listener
    • addPlaceholderInsertedListener

      protected com.vaadin.flow.shared.Registration addPlaceholderInsertedListener(com.vaadin.flow.component.ComponentEventListener<GeneratedEnhancedRichTextEditor.PlaceholderInsertedEvent<R>> listener)
      Adds a listener for PlaceholderInsertedEvent events fired by the webcomponent.
      Parameter:
      listener - the listener
      Gibt zurück:
      a Registration for removing the event listener
    • addPlaceholderSelectedListener

      protected com.vaadin.flow.shared.Registration addPlaceholderSelectedListener(com.vaadin.flow.component.ComponentEventListener<GeneratedEnhancedRichTextEditor.PlaceholderSelectedEvent<R>> listener)
      Adds a listener for PlaceholderSelectedEvent events fired by the webcomponent.
      Parameter:
      listener - the listener
      Gibt zurück:
      a Registration for removing the event listener
    • addPlaceholderLeaveListener

      protected com.vaadin.flow.shared.Registration addPlaceholderLeaveListener(com.vaadin.flow.component.ComponentEventListener<GeneratedEnhancedRichTextEditor.PlaceholderLeaveEvent<R>> listener)
      Adds a listener for PlaceholderAppearanceChangedEvent events fired by the webcomponent.
      Parameter:
      listener - the listener
      Gibt zurück:
      a Registration for removing the event listener
    • addPlaceholderAppearanceChangedListener

      protected com.vaadin.flow.shared.Registration addPlaceholderAppearanceChangedListener(com.vaadin.flow.component.ComponentEventListener<GeneratedEnhancedRichTextEditor.PlaceholderAppearanceChangedEvent<R>> listener)
      Adds a listener for PlaceholderAppearanceChangedEvent events fired by the webcomponent.
      Parameter:
      listener - the listener
      Gibt zurück:
      a Registration for removing the event listener
    • focus

      public void focus()
      Angegeben von:
      focus in Schnittstelle com.vaadin.flow.component.Focusable<R extends GeneratedEnhancedRichTextEditor<R,T>>