Package org.vaadin.hugerte
Class HugeRte
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.AbstractField<com.vaadin.flow.component.customfield.CustomField<T>,T>
com.vaadin.flow.component.customfield.CustomField<String>
org.vaadin.hugerte.HugeRte
- 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.HasThemeVariant<HugeRteVariant>,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> Serializable
@JavaScript("context://frontend/hugerteConnector.js")
@StyleSheet("context://frontend/hugerteLumo.css")
public class HugeRte
extends com.vaadin.flow.component.customfield.CustomField<String>
implements com.vaadin.flow.component.HasSize, com.vaadin.flow.component.shared.HasThemeVariant<HugeRteVariant>
A Rich Text editor, based on HugeRTE JS component.
- Author:
- mstahv
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class com.vaadin.flow.component.AbstractField
com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<C extends com.vaadin.flow.component.Component,V extends Object> 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
ConstructorsConstructorDescriptionHugeRte()Creates a new instance.HugeRte(com.vaadin.flow.component.HasValue.ValueChangeListener<? super com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<String>, String>> valueChangeListener) Creates a new instance with the given value change listener.Creates a new instance with the given label.HugeRte(String label, com.vaadin.flow.component.HasValue.ValueChangeListener<? super com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<String>, String>> valueChangeListener) Creates a new instance with the given label and value change listener.Creates a new instance with the given label and initial value.HugeRte(String label, String initialValue, com.vaadin.flow.component.HasValue.ValueChangeListener<? super com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<String>, String>> valueChangeListener) Creates a new instance with the given label, initial value and value change listener. -
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.RegistrationaddBlurListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.BlurNotifier.BlurEvent<com.vaadin.flow.component.customfield.CustomField<String>>> listener) com.vaadin.flow.shared.RegistrationaddFocusListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.FocusNotifier.FocusEvent<com.vaadin.flow.component.customfield.CustomField<String>>> listener) voidblur()voidconfigureLanguage(Language language) configureMenubar(boolean setupBasicConfig, Menubar... menubars) configureMenubar(Menubar... menubars) configurePlugins(boolean setupBasicConfig, Plugin... plugins) configurePlugins(Plugin... plugins) configureToolbar(boolean setupBasicConfig, Toolbar... toolbars) configureToolbar(Toolbar... toolbars) voidfocus()protected StringDeprecated.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.voidsetEnabled(boolean enabled) protected voidsetPresentationValue(String html) voidsetReadOnly(boolean readOnly) voidDefine the mode of value change triggering.Methods inherited from class com.vaadin.flow.component.customfield.CustomField
add, addThemeVariants, getLabel, remove, removeThemeVariants, setLabel, updateValueMethods inherited from class com.vaadin.flow.component.AbstractField
addValueChangeListener, getEmptyValue, getValue, isEmpty, setModelValue, setValue, valueEqualsMethods 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, 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.HasHelper
getHelperComponent, getHelperText, setHelperComponent, setHelperTextMethods 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.HasTheme
addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeNameMethods inherited from interface com.vaadin.flow.component.shared.HasThemeVariant
addThemeVariants, removeThemeVariantsMethods inherited from interface com.vaadin.flow.component.shared.HasTooltip
getTooltip, setTooltipTextMethods inherited from interface com.vaadin.flow.component.HasValidation
setManualValidationMethods inherited from interface com.vaadin.flow.component.shared.HasValidationProperties
getErrorMessage, isInvalid, setErrorMessage, setInvalidMethods inherited from interface com.vaadin.flow.component.HasValue
addValueChangeListener, clear, getEmptyValue, getOptionalValue, getValue, isEmpty, setValueMethods inherited from interface com.vaadin.flow.component.HasValueAndElement
isReadOnly, isRequiredIndicatorVisible, setRequiredIndicatorVisible
-
Constructor Details
-
HugeRte
public HugeRte()Creates a new instance. Use the different `configure` methods to apply any necessary configuration before attaching it. -
HugeRte
Creates a new instance with the given label.- Parameters:
label- label
-
HugeRte
Creates a new instance with the given label and initial value. The initial value is set as it is without any further processing.- Parameters:
label- labelinitialValue- initial value
-
HugeRte
public HugeRte(String label, String initialValue, com.vaadin.flow.component.HasValue.ValueChangeListener<? super com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<String>, String>> valueChangeListener) Creates a new instance with the given label, initial value and value change listener. The initial value is set as it is without any further processing.- Parameters:
label- labelinitialValue- initial valuevalueChangeListener- value change listener
-
HugeRte
public HugeRte(String label, com.vaadin.flow.component.HasValue.ValueChangeListener<? super com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<String>, String>> valueChangeListener) Creates a new instance with the given label and value change listener.- Parameters:
label- labelvalueChangeListener- value change listener
-
HugeRte
public HugeRte(com.vaadin.flow.component.HasValue.ValueChangeListener<? super com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<String>, String>> valueChangeListener) Creates a new instance with the given value change listener.- Parameters:
valueChangeListener- value change listener
-
-
Method Details
-
generateModelValue
- Specified by:
generateModelValuein classcom.vaadin.flow.component.customfield.CustomField<String>
-
setValueChangeMode
Define the mode of value change triggering. BLUR: Value is triggered only when HugeRTE loses focus, TIMEOUT: HugeRTE will send value change eagerly but debounced with timeout, CHANGE: value change is sent when HugeRTE 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:
-
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
Deprecated. -
setConfig
Sets the base configuration object as RAW JS. So be very careful what you pass in here.- Parameters:
jsConfig- config to apply
-
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
-
injectEditorScript
protected void injectEditorScript()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<com.vaadin.flow.component.customfield.CustomField<String>>
-
addFocusListener
public com.vaadin.flow.shared.Registration addFocusListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.FocusNotifier.FocusEvent<com.vaadin.flow.component.customfield.CustomField<String>>> listener) - Specified by:
addFocusListenerin interfacecom.vaadin.flow.component.FocusNotifier<com.vaadin.flow.component.customfield.CustomField<String>>
-
addBlurListener
public com.vaadin.flow.shared.Registration addBlurListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.BlurNotifier.BlurEvent<com.vaadin.flow.component.customfield.CustomField<String>>> listener) - Specified by:
addBlurListenerin interfacecom.vaadin.flow.component.BlurNotifier<com.vaadin.flow.component.customfield.CustomField<String>>
-
blur
public void blur()- Specified by:
blurin interfacecom.vaadin.flow.component.Focusable<com.vaadin.flow.component.customfield.CustomField<String>>
-
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<com.vaadin.flow.component.customfield.CustomField<String>,String>, String> - Specified by:
setReadOnlyin interfacecom.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<String>,String>, String>
-
setPresentationValue
- Specified by:
setPresentationValuein classcom.vaadin.flow.component.customfield.CustomField<String>
-
configurePlugins
-
configurePlugins
-
configureMenubar
-
configureMenubar
-
configureToolbar
-
configureToolbar
-
closeToolbarOverflowMenu
public void closeToolbarOverflowMenu()
-