Klasse EnhancedRichTextEditor

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.AbstractField<EnhancedRichTextEditor,String>
com.vaadin.flow.component.AbstractSinglePropertyField<EnhancedRichTextEditor,String>
Alle implementierten Schnittstellen:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.BlurNotifier<GeneratedEnhancedRichTextEditor<EnhancedRichTextEditor,String>>, com.vaadin.flow.component.CompositionNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.Focusable<GeneratedEnhancedRichTextEditor<EnhancedRichTextEditor,String>>, com.vaadin.flow.component.FocusNotifier<GeneratedEnhancedRichTextEditor<EnhancedRichTextEditor,String>>, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasEnabled, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.HasTheme, com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<EnhancedRichTextEditor,String>,String>, com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<EnhancedRichTextEditor,String>,String>, com.vaadin.flow.component.InputNotifier, com.vaadin.flow.component.KeyNotifier, com.vaadin.flow.data.value.HasValueChangeMode, Serializable

@Tag("vcf-enhanced-rich-text-editor") @JsModule("./richTextEditorConnector-npm.js") @JavaScript("./richTextEditorConnector.js") @NpmPackage(value="@vaadin/vaadin-license-checker", version="^2.1.2") public class EnhancedRichTextEditor extends GeneratedEnhancedRichTextEditor<EnhancedRichTextEditor,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
Server-side component for the <vcf-enhanced-rich-text-editor> component.
Autor:
Vaadin Ltd
Siehe auch:
  • Konstruktordetails

    • EnhancedRichTextEditor

      public EnhancedRichTextEditor()
      Constructs an empty EnhancedRichTextEditor.
    • EnhancedRichTextEditor

      public EnhancedRichTextEditor(String initialValue)
      Constructs a EnhancedRichTextEditor with the initial value
      Parameter:
      initialValue - the initial value
      Siehe auch:
      • AbstractField.setValue(Object)
    • EnhancedRichTextEditor

      public EnhancedRichTextEditor(com.vaadin.flow.component.HasValue.ValueChangeListener<? super com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<EnhancedRichTextEditor,String>> listener)
      Constructs an empty TextField with a value change listener.
      Parameter:
      listener - the value change listener
      Siehe auch:
      • AbstractField.addValueChangeListener(com.vaadin.flow.component.HasValue.ValueChangeListener)
    • EnhancedRichTextEditor

      public EnhancedRichTextEditor(String initialValue, com.vaadin.flow.component.HasValue.ValueChangeListener<? super com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<EnhancedRichTextEditor,String>> listener)
      Constructs an empty EnhancedRichTextEditor with a value change listener and an initial value.
      Parameter:
      initialValue - the initial value
      listener - the value change listener
      Siehe auch:
      • AbstractField.setValue(Object)
      • AbstractField.addValueChangeListener(com.vaadin.flow.component.HasValue.ValueChangeListener)
  • Methodendetails

    • getI18n

      Gets the internationalization object previously set for this component.

      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)

      Gibt zurück:
      the i18n object. It will be null, If the i18n properties weren't set.
    • setI18n

      public void setI18n(EnhancedRichTextEditor.RichTextEditorI18n i18n)
      Sets the internationalization properties for this component.
      Parameter:
      i18n - the internationalized properties, not null
    • getToolbarButtonsVisibility

      public Map<EnhancedRichTextEditor.ToolbarButton,Boolean> getToolbarButtonsVisibility()
    • setToolbarButtonsVisibility

      public void setToolbarButtonsVisibility(Map<EnhancedRichTextEditor.ToolbarButton,Boolean> toolbarButtonsVisibility)
      Set which toolbar buttons are visible.
      Parameter:
      toolbarButtonsVisibility - Map of button and boolean value. Boolean value false associated with the button means that button will be hidden.
    • getValueChangeMode

      public com.vaadin.flow.data.value.ValueChangeMode getValueChangeMode()

      The default value is ValueChangeMode.ON_CHANGE.

      Angegeben von:
      getValueChangeMode in Schnittstelle com.vaadin.flow.data.value.HasValueChangeMode
    • setValueChangeMode

      public void setValueChangeMode(com.vaadin.flow.data.value.ValueChangeMode valueChangeMode)
      Angegeben von:
      setValueChangeMode in Schnittstelle com.vaadin.flow.data.value.HasValueChangeMode
    • setValue

      public void setValue(String value)
      Sets the value of this editor. Should be in Delta format. If the new value is not equal to getValue(), fires a value change event. Throws NullPointerException, if the value is null.

      Automatically detects and converts old-format deltas (containing tabs-cont, pre-tab, line-part blots) to the new embed-based tab format.

      Note: Binder will take care of the null conversion when integrates with the editor, as long as no new converter is defined.

      Angegeben von:
      setValue in Schnittstelle com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<EnhancedRichTextEditor,String>,String>
      Setzt außer Kraft:
      setValue in Klasse com.vaadin.flow.component.AbstractField<EnhancedRichTextEditor,String>
      Parameter:
      value - the new value in Delta format, not null
    • getValue

      public String getValue()
      Returns the current value of the text editor in Delta format. By default, the empty editor will return an empty string.
      Angegeben von:
      getValue in Schnittstelle com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<EnhancedRichTextEditor,String>,String>
      Setzt außer Kraft:
      getValue in Klasse com.vaadin.flow.component.AbstractField<EnhancedRichTextEditor,String>
      Gibt zurück:
      the current value.
    • getHtmlValue

      public String getHtmlValue()
      Value of the editor presented as HTML string.
      Gibt zurück:
      the sanitized htmlValue property from the webcomponent.
    • setShowWhitespace

      public void setShowWhitespace(boolean show)
      Sets whether whitespace indicators are shown in the editor. When true, special characters are displayed: → (tab), ↵ (soft-break), ¶ (paragraph), ⮐ (auto-wrap).
      Parameter:
      show - true to show whitespace indicators
    • isShowWhitespace

      public boolean isShowWhitespace()
      Returns whether whitespace indicators are currently shown.
      Gibt zurück:
      true if whitespace indicators are visible
    • setPlaceholders

      public void setPlaceholders(Collection<Placeholder> placeholders)
      Set placeholders shown in the Placeholder drop down menu.
      Parameter:
      placeholders - Collection of Placeholder objects
    • getPlaceholders

      @Synchronize(property="placeholders", value="placeholders-changed") public Collection<Placeholder> getPlaceholders()
    • setPlaceholderAltAppearancePattern

      public void setPlaceholderAltAppearancePattern(String pattern)
    • getPlaceholderAltAppearancePattern

      @Synchronize(property="placeholderAltAppearancePattern", value="placeholder-alt-appearance-pattern-changed") public String getPlaceholderAltAppearancePattern()
    • setPlacehoderAltAppearance

      public void setPlacehoderAltAppearance(boolean altAppearance)
    • isPlacehoderAltAppearance

      @Synchronize(property="placeholderAltAppearance", value="placeholder-alt-appearance-changed") public boolean isPlacehoderAltAppearance()
    • getPlaceholder

      protected Placeholder getPlaceholder(Placeholder placeholder)
      For internal use only. Return Placeholder from the master list matching the given Placeholder by getText.
      Parameter:
      placeholder - The Placeholder to be searched.
      Gibt zurück:
      A Placeholder
    • getTextLength

      public int getTextLength()
      Return the length of the content stripped as text.
      Gibt zurück:
      The length of the text content.
    • addText

      public void addText(String text, int position)
      Add a text to the position. Text will be added if position is within 0 .. length of the current value of the text area.
      Parameter:
      text - Text to be inserted
      position - Position
    • addText

      public void addText(String text)
      Add text to the caret position, when the focus is in the text area.
      Parameter:
      text - Text to be inserted
    • addCustomButton

      @Deprecated public void addCustomButton(com.vaadin.flow.component.button.Button button)
      Add a custom button to the toolbar.
      This method does NOT apply any toolbar styling to the button, but will keep it "Vaadin native".
      Parameter:
      button - A custom button to be added, not null
    • addCustomButtons

      @Deprecated public void addCustomButtons(com.vaadin.flow.component.button.Button... buttons)
      A convenience method to add multiple custom buttons at one call.
      This method does NOT apply any toolbar styling to the button, but will keep it "Vaadin native".
      Parameter:
      buttons - Custom buttons to be added.
    • addCustomToolbarComponents

      public void addCustomToolbarComponents(com.vaadin.flow.component.Component... components)
      A convenience method to add multiple custom components at one call. Uses the ToolbarSlot.GROUP_CUSTOM.
      Parameter:
      components - Custom components to be added.
    • addCustomToolbarComponentsAtIndex

      public void addCustomToolbarComponentsAtIndex(int index, com.vaadin.flow.component.Component... components)
      A convenience method to add multiple custom components at one call. Uses the ToolbarSlot.GROUP_CUSTOM. The index allows to define the position of the newly added components relative to already existing ones.
      Parameter:
      index - index
      components - Custom components to be added.
    • addToolbarComponents

      public void addToolbarComponents(ToolbarSlot toolbarSlot, com.vaadin.flow.component.Component... components)
      Adds the components to the toolbar slot. Appends the components to existing ones.
      Parameter:
      toolbarSlot - slot to add the components to
      components - Components to be added
    • addToolbarComponentsAtIndex

      public void addToolbarComponentsAtIndex(ToolbarSlot toolbarSlot, int index, com.vaadin.flow.component.Component... components)
      Adds the components to the toolbar slot. Appends the components to existing ones. The index allows to define the position of the newly added components relative to already existing ones.
      Parameter:
      toolbarSlot - slot to add the components to
      components - Components to be added
    • getToolbarComponent

      public <T extends com.vaadin.flow.component.Component> T getToolbarComponent(ToolbarSlot toolbarSlot, String id)
      Returns a toolbar component with the given id from the toolbar slot. The component must have been added using one of the addToolbarComponents methods beforehand.
      Typparameter:
      T - return type
      Parameter:
      toolbarSlot - toolbar slot
      id - component id
      Gibt zurück:
      component
    • removeToolbarComponent

      public void removeToolbarComponent(ToolbarSlot toolbarSlot, String id)
      Remove the given component from the toolbar. The component must have been added using one of the addToolbarComponents methods beforehand.
      Parameter:
      id - component id
    • removeToolbarComponent

      public void removeToolbarComponent(ToolbarSlot toolbarSlot, com.vaadin.flow.component.Component component)
      Remove a custom component from the toolbar. The component must have been added using one of the addToolbarComponents methods beforehand.
      Parameter:
      component - The component to be removed.
    • getCustomButton

      @Deprecated public com.vaadin.flow.component.button.Button getCustomButton(String id)
      Get the custom button using its id.
      Parameter:
      id - Id as a string
      Gibt zurück:
      A button
    • removeCustomButton

      @Deprecated public void removeCustomButton(String id)
      Remove the given button from the toolbar.
      Parameter:
      id - Id as a string.
    • removeCustomButton

      @Deprecated public void removeCustomButton(com.vaadin.flow.component.button.Button button)
      Remove a custom button from the toolbar.
      Parameter:
      button - The button to be removed.
    • addStandardToolbarButtonShortcut

      public void addStandardToolbarButtonShortcut(EnhancedRichTextEditor.ToolbarButton toolbarButton, Number keyCode, Boolean shortKey, Boolean shiftKey, Boolean altKey)
      Adds a custom shortcut to a specific toolbar standard button.
      Parameter:
      toolbarButton - The toolbar button to add the shortcut to.
      keyCode - The key code for the new shortcut.
      shortKey - True if modifier ctrl is part of the shortcut.
      shiftKey - True if modifier shift is part of the shortcut.
      altKey - True if modifier alt is part of the shortcut.
    • addToobarFocusShortcut

      public void addToobarFocusShortcut(Number keyCode, Boolean shortKey, Boolean shiftKey, Boolean altKey)
      Adds a custom shortcut to focus the editor toolbar.
      Parameter:
      keyCode - The key code for the new shortcut.
      shortKey - True if modifier ctrl is part of the shortcut.
      shiftKey - True if modifier shift is part of the shortcut.
      altKey - True if modifier alt is part of the shortcut.
    • replaceStandardToolbarButtonIcon

      public void replaceStandardToolbarButtonIcon(EnhancedRichTextEditor.ToolbarButton toolbarButton, com.vaadin.flow.component.icon.Icon icon)
      Allows to replace the icon of a standard toolbar button.
      Parameter:
      toolbarButton - toolbar button to replace icon
      icon - replacement icon