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.HasSizeA 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:
- Serialized Form
-
-
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<?>>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TinyMceconfigure(String configurationKey, boolean value)TinyMceconfigure(String configurationKey, double value)TinyMceconfigure(String configurationKey, String value)TinyMceconfigure(String configurationKey, String... value)voidfocus()StringgetCurrentValue()protected voidinjectTinyMceScript()Injects 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).voidsetConfig(String jsonConfig)voidsetEditorContent(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, setVisible
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.github.legioth.field.Field
addValueChangeListener, getEmptyValue, getValue, isReadOnly, isRequiredIndicatorVisible, setRequiredIndicatorVisible, setValue
-
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
-
-
-
-
Constructor Detail
-
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 Detail
-
setEditorContent
public void setEditorContent(String html)
-
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
public String getCurrentValue()
-
setConfig
public void setConfig(String jsonConfig)
-
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()
-
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>
-
-