Class TinyMce

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<C>
com.vaadin.flow.component.AbstractCompositeField<com.vaadin.flow.component.html.Div,TinyMce,String>
org.vaadin.tinymce.TinyMce
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.BlurNotifier<TinyMce>, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.Focusable<TinyMce>, com.vaadin.flow.component.FocusNotifier<TinyMce>, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasEnabled, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<TinyMce,String>,String>, com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<TinyMce,String>,String>, Serializable

@Tag("div") @JavaScript("context://frontend/tinymceConnector.js") @StyleSheet("context://frontend/tinymceLumo.css") public class TinyMce extends com.vaadin.flow.component.AbstractCompositeField<com.vaadin.flow.component.html.Div,TinyMce,String> implements com.vaadin.flow.component.HasSize, com.vaadin.flow.component.Focusable<TinyMce>
A Rich Text editor, based on TinyMCE Web Component.

Some configurations has Java shorthand, some must be adjusted via getElement().setAttribute(String, String). See full options via https://www.tiny.cloud/docs/integrations/webcomponent/

Author:
mstahv
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from interface com.vaadin.flow.component.BlurNotifier

    com.vaadin.flow.component.BlurNotifier.BlurEvent<C extends com.vaadin.flow.component.Component>

    Nested classes/interfaces inherited from interface com.vaadin.flow.component.FocusNotifier

    com.vaadin.flow.component.FocusNotifier.FocusEvent<C extends com.vaadin.flow.component.Component>

    Nested classes/interfaces inherited from interface com.vaadin.flow.component.HasValue

    com.vaadin.flow.component.HasValue.ValueChangeEvent<V extends Object>, com.vaadin.flow.component.HasValue.ValueChangeListener<E extends com.vaadin.flow.component.HasValue.ValueChangeEvent<?>>
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    TinyMce(boolean shadowRoot)
    Deprecated.
    No longer needed since version x.x
  • Method Summary

    Modifier and Type
    Method
    Description
    com.vaadin.flow.shared.Registration
    addBlurListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.BlurNotifier.BlurEvent<TinyMce>> listener)
     
    com.vaadin.flow.shared.Registration
    addFocusListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.FocusNotifier.FocusEvent<TinyMce>> listener)
     
    void
     
    configure(String configurationKey, boolean value)
     
    configure(String configurationKey, double value)
     
    configure(String configurationKey, String value)
     
    configure(String configurationKey, String... value)
     
     
    configureMenubar(boolean basicTinyMCE, Menubar... menubars)
     
    configurePlugin(boolean basicTinyMCE, Plugin... plugins)
     
    configureToolbar(boolean basicTinyMCE, Toolbar... toolbars)
     
    void
     
     
    protected void
    Injects actual editor script to the host page from the add-on bundle.
    protected void
    onAttach(com.vaadin.flow.component.AttachEvent attachEvent)
     
    protected void
    onDetach(com.vaadin.flow.component.DetachEvent detachEvent)
     
    void
    Replaces text in the editors selection (can be just a caret position).
    void
    setConfig(String jsonConfig)
     
    void
    setDebounceTimeout(int debounceTimeout)
    Sets the debounce timeout for the value change event.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    use AbstractCompositeField.setValue(Object) instead
    void
    setEnabled(boolean enabled)
     
    protected void
     
    void
    setReadOnly(boolean readOnly)
     
    void
    Define the mode of value change triggering.

    Methods inherited from class com.vaadin.flow.component.AbstractCompositeField

    addValueChangeListener, getEmptyValue, getValue, isEmpty, setModelValue, setValue, valueEquals

    Methods inherited from class com.vaadin.flow.component.Composite

    getChildren, getContent, getElement, initContent

    Methods inherited from class com.vaadin.flow.component.Component

    addListener, findAncestor, fireEvent, from, get, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onEnabledStateChanged, removeFromParent, scrollIntoView, 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.Focusable

    addFocusShortcut, getTabIndex, setTabIndex

    Methods inherited from interface com.vaadin.flow.component.HasElement

    getElement

    Methods inherited from interface com.vaadin.flow.component.HasEnabled

    isEnabled

    Methods inherited from interface com.vaadin.flow.component.HasSize

    getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull

    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.HasValue

    clear, getOptionalValue

    Methods inherited from interface com.vaadin.flow.component.HasValueAndElement

    isReadOnly, isRequiredIndicatorVisible, setRequiredIndicatorVisible
  • Constructor Details

    • TinyMce

      @Deprecated public TinyMce(boolean shadowRoot)
      Deprecated.
      No longer needed since version x.x
      Creates a new TinyMce editor with shadowroot set or disabled. The shadow root should be used if the editor is in used in Dialog component, otherwise menu's and certain other features don't work. On the other hand, the shadow root must not be on when for example used in inline mode.
      Parameters:
      shadowRoot - true of shadow root hack should be used
    • TinyMce

      public TinyMce()
  • Method Details

    • setValueChangeMode

      public void setValueChangeMode(ValueChangeMode mode)
      Define the mode of value change triggering. BLUR: Value is triggered only when TinyMce loses focus, TIMEOUT: TinyMce will send value change eagerly but debounced with timeout, CHANGE: value change is sent when TinyMce emits change event (e.g. enter, tab)
      Parameters:
      mode - The mode.
      See Also:
    • setDebounceTimeout

      public void setDebounceTimeout(int debounceTimeout)
      Sets the debounce timeout for the value change event. The default is 0, when value change is triggered on blur and enter key presses. When value is more than 0 the value change is emitted with delay of given timeout milliseconds after last keystroke.
      Parameters:
      debounceTimeout - the debounce timeout in milliseconds
      See Also:
    • setEditorContent

      @Deprecated(forRemoval=true) public void setEditorContent(String html)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use AbstractCompositeField.setValue(Object) instead
      Old public method from era when this component didn't properly implement the HasValue interfaces. Don't use this but the standard setValue method instead.
      Parameters:
      html -
    • onAttach

      protected void onAttach(com.vaadin.flow.component.AttachEvent attachEvent)
      Overrides:
      onAttach in class com.vaadin.flow.component.Component
    • onDetach

      protected void onDetach(com.vaadin.flow.component.DetachEvent detachEvent)
      Overrides:
      onDetach in class com.vaadin.flow.component.Component
    • getCurrentValue

      public String getCurrentValue()
    • setConfig

      public void setConfig(String jsonConfig)
    • configure

      public TinyMce configure(String configurationKey, String value)
    • configure

      public TinyMce configure(String configurationKey, String... value)
    • configure

      public TinyMce configure(String configurationKey, boolean value)
    • configure

      public TinyMce configure(String configurationKey, double value)
    • configureLanguage

      public TinyMce configureLanguage(Language language)
    • replaceSelectionContent

      public void replaceSelectionContent(String htmlString)
      Replaces text in the editors selection (can be just a caret position).
      Parameters:
      htmlString - the html snippet to be inserted
    • injectTinyMceScript

      protected void injectTinyMceScript()
      Injects actual editor script to the host page from the add-on bundle.

      Override this with an empty implementation if you to use the cloud hosted version, or own custom script if needed.

    • focus

      public void focus()
      Specified by:
      focus in interface com.vaadin.flow.component.Focusable<TinyMce>
    • addFocusListener

      public com.vaadin.flow.shared.Registration addFocusListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.FocusNotifier.FocusEvent<TinyMce>> listener)
      Specified by:
      addFocusListener in interface com.vaadin.flow.component.FocusNotifier<TinyMce>
    • addBlurListener

      public com.vaadin.flow.shared.Registration addBlurListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.BlurNotifier.BlurEvent<TinyMce>> listener)
      Specified by:
      addBlurListener in interface com.vaadin.flow.component.BlurNotifier<TinyMce>
    • blur

      public void blur()
      Specified by:
      blur in interface com.vaadin.flow.component.Focusable<TinyMce>
    • setEnabled

      public void setEnabled(boolean enabled)
      Specified by:
      setEnabled in interface com.vaadin.flow.component.HasEnabled
    • setReadOnly

      public void setReadOnly(boolean readOnly)
      Specified by:
      setReadOnly in interface com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<TinyMce,String>,String>
      Specified by:
      setReadOnly in interface com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<TinyMce,String>,String>
    • setPresentationValue

      protected void setPresentationValue(String html)
      Specified by:
      setPresentationValue in class com.vaadin.flow.component.AbstractCompositeField<com.vaadin.flow.component.html.Div,TinyMce,String>
    • configurePlugin

      public TinyMce configurePlugin(boolean basicTinyMCE, Plugin... plugins)
    • configureMenubar

      public TinyMce configureMenubar(boolean basicTinyMCE, Menubar... menubars)
    • configureToolbar

      public TinyMce configureToolbar(boolean basicTinyMCE, Toolbar... toolbars)