Package org.vaadin.hugerte
Class HugeRte
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.BlurNotifier<HugeRte>,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.Focusable<HugeRte>,com.vaadin.flow.component.FocusNotifier<HugeRte>,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<HugeRte,,String>, String> com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<HugeRte,,String>, String> Serializable
@Tag("div")
@JavaScript("context://frontend/hugerteConnector.js")
@StyleSheet("context://frontend/hugerteLumo.css")
public class HugeRte
extends com.vaadin.flow.component.AbstractCompositeField<com.vaadin.flow.component.html.Div,HugeRte,String>
implements com.vaadin.flow.component.HasSize, com.vaadin.flow.component.Focusable<HugeRte>
A Rich Text editor, based on HugeRTE JS component.
- 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 -
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.RegistrationaddBlurListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.BlurNotifier.BlurEvent<HugeRte>> listener) com.vaadin.flow.shared.RegistrationaddFocusListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.FocusNotifier.FocusEvent<HugeRte>> listener) voidblur()configureLanguage(Language language) configureMenubar(boolean basicTinyMCE, Menubar... menubars) configurePlugin(boolean basicTinyMCE, Plugin... plugins) configureToolbar(boolean basicTinyMCE, Toolbar... toolbars) voidfocus()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).voidSets the base configuration object as RAW JS.voidsetDebounceTimeout(int debounceTimeout) Sets the debounce timeout for the value change event.voidsetEditorContent(String html) Deprecated, for removal: This API element is subject to removal in a future version.useAbstractCompositeField.setValue(Object)insteadvoidsetEnabled(boolean enabled) protected voidsetPresentationValue(String html) voidsetReadOnly(boolean readOnly) voidDefine the mode of value change triggering.Methods inherited from class com.vaadin.flow.component.AbstractCompositeField
addValueChangeListener, getEmptyValue, getValue, isEmpty, setModelValue, setValue, valueEqualsMethods inherited from class com.vaadin.flow.component.Composite
getChildren, getContent, getElement, initContentMethods 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, 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 com.vaadin.flow.component.Focusable
addFocusShortcut, getTabIndex, setTabIndexMethods 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.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.HasValue
clear, getOptionalValueMethods inherited from interface com.vaadin.flow.component.HasValueAndElement
isReadOnly, isRequiredIndicatorVisible, setRequiredIndicatorVisible
-
Constructor Details
-
HugeRte
Deprecated.No longer needed since version x.xCreates 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
-
HugeRte
public HugeRte()
-
-
Method Details
-
setValueChangeMode
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, for removal: This API element is subject to removal in a future version.useAbstractCompositeField.setValue(Object)insteadOld 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:
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
Sets the base configuration object as RAW JS. So be very careful what you pass in here.- Parameters:
jsConfig-
-
configure
-
configure
-
configure
-
configure
-
configureLanguage
-
replaceSelectionContent
Replaces text in the editors selection (can be just a caret position).Note, that this updates the value on the client-side on the next round-trip, so the value on the server side is not necessarily up-to-date, right after this call, but will be synced soon and a value change event will be fired after a small timeout.
- 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:
focusin interfacecom.vaadin.flow.component.Focusable<HugeRte>
-
addFocusListener
public com.vaadin.flow.shared.Registration addFocusListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.FocusNotifier.FocusEvent<HugeRte>> listener) - Specified by:
addFocusListenerin interfacecom.vaadin.flow.component.FocusNotifier<HugeRte>
-
addBlurListener
public com.vaadin.flow.shared.Registration addBlurListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.BlurNotifier.BlurEvent<HugeRte>> listener) - Specified by:
addBlurListenerin interfacecom.vaadin.flow.component.BlurNotifier<HugeRte>
-
blur
public void blur()- Specified by:
blurin interfacecom.vaadin.flow.component.Focusable<HugeRte>
-
setEnabled
public void setEnabled(boolean enabled) - Specified by:
setEnabledin interfacecom.vaadin.flow.component.HasEnabled
-
setReadOnly
public void setReadOnly(boolean readOnly) - Specified by:
setReadOnlyin interfacecom.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<HugeRte,String>, String> - Specified by:
setReadOnlyin interfacecom.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<HugeRte,String>, String>
-
setPresentationValue
-
configurePlugin
-
configureMenubar
-
configureToolbar
-