Class VaadinCKEditor

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.AbstractField<com.vaadin.flow.component.customfield.CustomField<String>, String>
com.vaadin.flow.component.customfield.CustomField<String>
com.wontlost.ckeditor.VaadinCKEditor
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.BlurNotifier<com.vaadin.flow.component.customfield.CustomField<String>>, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.Focusable<com.vaadin.flow.component.customfield.CustomField<String>>, com.vaadin.flow.component.FocusNotifier<com.vaadin.flow.component.customfield.CustomField<String>>, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasEnabled, com.vaadin.flow.component.HasHelper, com.vaadin.flow.component.HasLabel, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.HasTheme, com.vaadin.flow.component.HasValidation, com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<String>, String>, String>, com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<String>, String>, String>, com.vaadin.flow.component.shared.HasTooltip, com.vaadin.flow.component.shared.HasValidationProperties, com.vaadin.flow.component.shared.InputField<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<String>, String>, String>, HasConfig, Serializable

@Tag("vaadin-ckeditor") @JsModule("./vaadin-ckeditor-utils.min.js") @JsModule("./vaadin-ckeditor.min.js") @JsModule("./translations/af.js") @JsModule("./translations/ar.js") @JsModule("./translations/ast.js") @JsModule("./translations/az.js") @JsModule("./translations/bg.js") @JsModule("./translations/bn.js") @JsModule("./translations/bs.js") @JsModule("./translations/ca.js") @JsModule("./translations/cs.js") @JsModule("./translations/da.js") @JsModule("./translations/de.js") @JsModule("./translations/de-ch.js") @JsModule("./translations/el.js") @JsModule("./translations/en-au.js") @JsModule("./translations/en-gb.js") @JsModule("./translations/eo.js") @JsModule("./translations/es.js") @JsModule("./translations/es-co.js") @JsModule("./translations/et.js") @JsModule("./translations/eu.js") @JsModule("./translations/fa.js") @JsModule("./translations/fi.js") @JsModule("./translations/fr.js") @JsModule("./translations/gl.js") @JsModule("./translations/gu.js") @JsModule("./translations/hi.js") @JsModule("./translations/he.js") @JsModule("./translations/hr.js") @JsModule("./translations/hu.js") @JsModule("./translations/id.js") @JsModule("./translations/it.js") @JsModule("./translations/ja.js") @JsModule("./translations/jv.js") @JsModule("./translations/km.js") @JsModule("./translations/kn.js") @JsModule("./translations/ko.js") @JsModule("./translations/ku.js") @JsModule("./translations/lt.js") @JsModule("./translations/lv.js") @JsModule("./translations/ms.js") @JsModule("./translations/nb.js") @JsModule("./translations/ne.js") @JsModule("./translations/nl.js") @JsModule("./translations/no.js") @JsModule("./translations/oc.js") @JsModule("./translations/pl.js") @JsModule("./translations/pt.js") @JsModule("./translations/pt-br.js") @JsModule("./translations/ro.js") @JsModule("./translations/ru.js") @JsModule("./translations/si.js") @JsModule("./translations/sk.js") @JsModule("./translations/sl.js") @JsModule("./translations/sq.js") @JsModule("./translations/sr.js") @JsModule("./translations/sr-latn.js") @JsModule("./translations/sv.js") @JsModule("./translations/th.js") @JsModule("./translations/tk.js") @JsModule("./translations/tr.js") @JsModule("./translations/tt.js") @JsModule("./translations/ug.js") @JsModule("./translations/uz.js") @JsModule("./translations/uk.js") @JsModule("./translations/ur.js") @JsModule("./translations/vi.js") @JsModule("./translations/zh.js") @JsModule("./translations/zh-cn.js") @CssImport("./styles.css") @CssImport("./ckeditor.css") @NpmPackage(value="lit", version="^3.2.1") public class VaadinCKEditor extends com.vaadin.flow.component.customfield.CustomField<String> implements HasConfig
Used in @VaadinCKEditorBuilder.
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.vaadin.flow.component.AbstractField

    com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<C,V>

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

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

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

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

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

    com.vaadin.flow.component.HasValue.ValueChangeEvent<V>, com.vaadin.flow.component.HasValue.ValueChangeListener<E>
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
    enableGHS(boolean enabled)
     
    protected String
     
     
     
    Get content of editor.
    void
     
    boolean
     
    void
    isSynchronizd(boolean sync)
     
    void
    minimap(Boolean enabled)
     
     
    void
    setConfig(Config config)
     
    void
    setHeight(String editorHeight)
     
    void
    setHideToolbar(boolean hideToolbar)
     
    void
     
    protected void
    setModelValue(String value, boolean fromClient)
     
    void
    setOverrideCssUrl(String overrideCssUrl)
     
    protected void
    setPresentationValue(String newPresentationValue)
     
    void
    setReadOnly(boolean readOnly)
     
    void
    setReadOnlyWithToolbarAction(boolean readOnly)
     
    void
    Set value of editor.
    void
    setWidth(String editorWidth)
     

    Methods inherited from class com.vaadin.flow.component.customfield.CustomField

    add, addThemeVariants, getLabel, remove, removeThemeVariants, setLabel, updateValue

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

    addValueChangeListener, getEmptyValue, isEmpty, valueEquals

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

    addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setVisible

    Methods inherited from class 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.BlurNotifier

    addBlurListener

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

    addDetachListener

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

    addFocusShortcut, blur, focus, focus, getTabIndex, setTabIndex

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

    addFocusListener

    Methods inherited from interface HasConfig

    getConfig

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

    getHelperComponent, getHelperText, setHelperComponent, setHelperText

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

    getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, 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.HasTheme

    addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeName

    Methods inherited from interface com.vaadin.flow.component.shared.HasTooltip

    getTooltip, setTooltipMarkdown, setTooltipText

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

    setManualValidation

    Methods inherited from interface com.vaadin.flow.component.shared.HasValidationProperties

    getErrorMessage, isInvalid, setErrorMessage, setInvalid

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

    addValueChangeListener, getEmptyValue, getOptionalValue, isEmpty

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

    isRequiredIndicatorVisible, setRequiredIndicatorVisible
  • Method Details

    • generateModelValue

      protected String generateModelValue()
      Specified by:
      generateModelValue in class com.vaadin.flow.component.customfield.CustomField<String>
    • setPresentationValue

      protected void setPresentationValue(String newPresentationValue)
      Specified by:
      setPresentationValue in class com.vaadin.flow.component.customfield.CustomField<String>
    • setId

      public void setId(String id)
      Overrides:
      setId in class com.vaadin.flow.component.Component
    • getId

      public Optional<String> getId()
      Overrides:
      getId in class com.vaadin.flow.component.Component
    • getValue

      public String getValue()
      Get content of editor.
      Specified by:
      getValue in interface com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<String>, String>, String>
      Overrides:
      getValue in class com.vaadin.flow.component.AbstractField<com.vaadin.flow.component.customfield.CustomField<String>, String>
      Returns:
      Data in editor text area.
    • setValue

      public void setValue(String value)
      Set value of editor. Together with calling updateValue method to refresh editor content
      Specified by:
      setValue in interface com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<String>, String>, String>
      Overrides:
      setValue in class com.vaadin.flow.component.AbstractField<com.vaadin.flow.component.customfield.CustomField<String>, String>
      Parameters:
      value - Data in editor text area.
    • setModelValue

      protected void setModelValue(String value, boolean fromClient)
      Overrides:
      setModelValue in class com.vaadin.flow.component.AbstractField<com.vaadin.flow.component.customfield.CustomField<String>, String>
    • minimap

      public void minimap(Boolean enabled)
      Parameters:
      enabled - if minimap is enabled. This only works for decoupled editor.
    • setWidth

      public void setWidth(String editorWidth)
      Specified by:
      setWidth in interface com.vaadin.flow.component.HasSize
      Parameters:
      editorWidth - Width of editor, default value is 'auto'.
    • setHeight

      public void setHeight(String editorHeight)
      Specified by:
      setHeight in interface com.vaadin.flow.component.HasSize
      Parameters:
      editorHeight - Height of editor, default value is 'auto'.
    • setReadOnly

      public void setReadOnly(boolean readOnly)
      Specified by:
      setReadOnly in interface com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<String>, String>, String>
      Specified by:
      setReadOnly in interface com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<String>, String>, String>
      Parameters:
      readOnly - Make editor readonly
    • enableGHS

      public void enableGHS(boolean enabled)
    • isSynchronizd

      public void isSynchronizd(boolean sync)
    • setReadOnlyWithToolbarAction

      public void setReadOnlyWithToolbarAction(boolean readOnly)
    • setHideToolbar

      public void setHideToolbar(boolean hideToolbar)
    • isReadOnly

      public boolean isReadOnly()
      Specified by:
      isReadOnly in interface com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<String>, String>, String>
      Specified by:
      isReadOnly in interface com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<String>, String>, String>
    • clear

      public void clear()
      Specified by:
      clear in interface com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<String>, String>, String>
    • setConfig

      public void setConfig(Config config)
      Specified by:
      setConfig in interface HasConfig
    • sanitizeHtml

      public String sanitizeHtml(String editorData, Constants.SanitizeType type)
    • insertText

      public void insertText(String text)
    • getContentText

      public String getContentText()
      Returns:
      content without html tags
    • setOverrideCssUrl

      public void setOverrideCssUrl(String overrideCssUrl)