Package org.vaadin.tinymce
Class TinyMce
java.lang.Object
com.vaadin.flow.component.Component
org.vaadin.tinymce.TinyMce
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasEnabled,com.vaadin.flow.component.HasSize,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,org.github.legioth.field.Field<TinyMce,String>
@Tag("div")
@JavaScript("./tinymceConnector.js")
public class TinyMce
extends com.vaadin.flow.component.Component
implements org.github.legioth.field.Field<TinyMce,String>, com.vaadin.flow.component.HasSize
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.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 -
Method Summary
Modifier and TypeMethodDescriptionvoidfocus()protected voidInjects actual editor script to the host page from the add-on bundle.protected voidonAttach(com.vaadin.flow.component.AttachEvent attachEvent) protected voidonDetach(com.vaadin.flow.component.DetachEvent detachEvent) voidreplaceSelectionContent(String htmlString) Replaces text in the editors selection (can be just a caret position).voidvoidsetEditorContent(String html) voidsetEnabled(boolean enabled) voidsetReadOnly(boolean readOnly) Methods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onEnabledStateChanged, scrollIntoView, set, setElement, setId, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface org.github.legioth.field.Field
addValueChangeListener, getEmptyValue, getValue, isReadOnly, isRequiredIndicatorVisible, setRequiredIndicatorVisible, setValueMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabledMethods 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, setWidthFullMethods inherited from interface com.vaadin.flow.component.HasValue
clear, getOptionalValue, isEmpty
-
Constructor Details
-
TinyMce
public TinyMce(boolean shadowRoot) 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
-
setEditorContent
-
onAttach
protected void onAttach(com.vaadin.flow.component.AttachEvent attachEvent) - Overrides:
onAttachin classcom.vaadin.flow.component.Component
-
onDetach
protected void onDetach(com.vaadin.flow.component.DetachEvent detachEvent) - Overrides:
onDetachin classcom.vaadin.flow.component.Component
-
getCurrentValue
-
setConfig
-
configure
-
configure
-
configure
-
configure
-
replaceSelectionContent
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() -
setEnabled
public void setEnabled(boolean enabled) - Specified by:
setEnabledin interfacecom.vaadin.flow.component.HasEnabled
-
setReadOnly
public void setReadOnly(boolean readOnly) - Specified by:
setReadOnlyin interfaceorg.github.legioth.field.Field<TinyMce,String> - Specified by:
setReadOnlyin interfacecom.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<TinyMce,String>, String> - Specified by:
setReadOnlyin interfacecom.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<TinyMce,String>, String>
-