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.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<HugeRte,,String>, String> com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<HugeRte,,String>, String> com.vaadin.flow.component.InputNotifier,com.vaadin.flow.component.shared.HasThemeVariant<HugeRteVariant>,com.vaadin.flow.component.shared.HasValidationProperties,com.vaadin.flow.data.binder.HasValidator<String>,Serializable
- Author:
- mstahv, Stefan Uebe
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.vaadin.flow.component.AbstractField
com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<C extends com.vaadin.flow.component.Component,V> 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>, com.vaadin.flow.component.HasValue.ValueChangeListener<E extends com.vaadin.flow.component.HasValue.ValueChangeEvent<?>> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe default height of the component.static final ValueChangeModeThe default value change mode.static final intThe default timeout in milliseconds forValueChangeMode.TIMEOUTandValueChangeMode.INTERVAL. -
Constructor Summary
ConstructorsConstructorDescriptionHugeRte()Creates a new instance.HugeRte(com.vaadin.flow.component.HasValue.ValueChangeListener<? super com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<HugeRte, 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<HugeRte, 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<HugeRte, String>> valueChangeListener) Creates a new instance with the given label, initial value and value change listener. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringapplyDelta(String oldValue, String delta) Applies the given delta onto the "old" value.Sets a single boolean value for the given configuration key.Sets a single number for the given configuration key.Sets a single string for the given configuration key.Sets an array of strings for the given configuration key.configure(String configurationKey, ClientSideReference value) Sets a single string for the given configuration key by reading the given client side reference's representation.Configures this instance with a default set of plugins, menubar and toolbar options enabled.configureLanguage(Language language) Sets the language the editor shall use.configureMenubar(Menubar... menubarItems) Configures the menubar of the editor instance to show the given items.configurePlugins(Plugin... plugins) Configures the plugins, that shall be enabled for this editor instance.configureResize(ResizeDirection direction) Configures the resize option for the editor.configureToolbar(Toolbar... toolbarItems) Configures the toolbar of the editor instance to show the given items.tools.jackson.databind.node.ObjectNodeReturns the current value change mode.intvoidreplaceSelectionContent(String htmlString) voidsetEditorHeight(int editorHeight) This convenience method sets the editor height in pixels.voidsetEditorHeight(String editorHeight) This convenience method sets the editor height.voidsetEditorMaxHeight(int editorMaxHeight) This convenience method sets the editor maximal height in pixels.voidsetEditorMinHeight(int editorMinHeight) This convenience method sets the editor minimal height in pixels.protected voidsetPresentationValue(String value) voidsetRawConfig(String jsConfig) voidsetValueChangeMode(ValueChangeMode valueChangeMode) Sets the value change mode of this instance.voidsetValueChangeTimeout(int timeoutInMilliseconds) Methods inherited from class com.vaadin.flow.component.AbstractSinglePropertyField
getSynchronizationRegistration, hasValidValue, setSynchronizedEventMethods inherited from class com.vaadin.flow.component.AbstractField
addValueChangeListener, bindValue, getEmptyValue, getValue, isEmpty, setModelValue, setValue, valueEqualsMethods inherited from class com.vaadin.flow.component.Component
addListener, bindVisible, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTestId, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setTestId, 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.BlurNotifier
addBlurListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.Focusable
addFocusShortcut, blur, focus, focus, getTabIndex, setTabIndexMethods inherited from interface com.vaadin.flow.component.FocusNotifier
addFocusListenerMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
bindEnabled, isEnabled, setEnabledMethods inherited from interface com.vaadin.flow.component.HasHelper
bindHelperText, getHelperComponent, getHelperText, setHelperComponent, setHelperTextMethods inherited from interface com.vaadin.flow.component.HasLabel
getLabel, setLabelMethods inherited from interface com.vaadin.flow.component.HasSize
bindHeight, bindWidth, 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, bindClassName, bindClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.HasTheme
addThemeName, addThemeNames, bindThemeName, bindThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeNameMethods inherited from interface com.vaadin.flow.component.shared.HasThemeVariant
addThemeVariants, bindThemeVariant, removeThemeVariants, setThemeVariant, setThemeVariants, setThemeVariantsMethods 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.data.binder.HasValidator
addValidationStatusChangeListener, getDefaultValidatorMethods inherited from interface com.vaadin.flow.component.HasValue
clear, getOptionalValueMethods inherited from interface com.vaadin.flow.component.HasValueAndElement
bindReadOnly, bindRequiredIndicatorVisible, isReadOnly, isRequiredIndicatorVisible, setReadOnly, setRequiredIndicatorVisibleMethods inherited from interface com.vaadin.flow.component.InputNotifier
addInputListener
-
Field Details
-
DEFAULT_VALUE_CHANGE_MODE_TIMEOUT
public static final int DEFAULT_VALUE_CHANGE_MODE_TIMEOUTThe default timeout in milliseconds forValueChangeMode.TIMEOUTandValueChangeMode.INTERVAL.- See Also:
-
DEFAULT_VALUE_CHANGE_MODE
The default value change mode. -
DEFAULT_HEIGHT
The default height of the component. Also used as the editor height of a resizable editor, that has no editor height set.- See Also:
-
-
Constructor Details
-
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<HugeRte, 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<HugeRte, 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<HugeRte, String>> valueChangeListener) Creates a new instance with the given value change listener.- Parameters:
valueChangeListener- value change listener
-
HugeRte
public HugeRte()Creates a new instance.
-
-
Method Details
-
setPresentationValue
-
applyDelta
Applies the given delta onto the "old" value. Returns the "new", resulting value- Parameters:
oldValue- old valuedelta- delta to apply- Returns:
- new value
-
setRawConfig
-
getConfig
public tools.jackson.databind.node.ObjectNode getConfig() -
configureBasicSetup
Configures this instance with a default set of plugins, menubar and toolbar options enabled.- Returns:
- this instance
-
configure
Sets a single string for the given configuration key. Please note, that there is no check, if the given config key exists or the value is valid or might be applied to this key.- Parameters:
configurationKey- config keyvalue- value to set- Returns:
- this instance
-
configure
Sets an array of strings for the given configuration key. The result will also be an array on the client side. Please note, that there is no check, if the given config key exists or the value is valid or might be applied to this key.- Parameters:
configurationKey- config keyvalue- value to set- Returns:
- this instance
-
configure
Sets a single boolean value for the given configuration key. Please note, that there is no check, if the given config key exists or the value is valid or might be applied to this key.- Parameters:
configurationKey- config keyvalue- value to set- Returns:
- this instance
-
configure
Sets a single number for the given configuration key. Please note, that there is no check, if the given config key exists or the value is valid or might be applied to this key.- Parameters:
configurationKey- config keyvalue- value to set- Returns:
- this instance
-
configure
Sets a single string for the given configuration key by reading the given client side reference's representation. Please note, that there is no check, if the given config key exists or the value is valid or might be applied to this key.- Parameters:
configurationKey- config keyvalue- value to set- Returns:
- this instance
-
configureLanguage
Sets the language the editor shall use. This dedicated method exists due to the special handling of theLanguage.ENGLISHitem.- Parameters:
language- language to set- Returns:
- this instance
-
configurePlugins
Configures the plugins, that shall be enabled for this editor instance. Previous settings will be overridden. Passing nothing will disable all plugins.- Parameters:
plugins- plugins to enable- Returns:
- this instance
-
configureMenubar
Configures the menubar of the editor instance to show the given items. Previous settings will be overridden. Passing nothing will hide the menubar.- Parameters:
menubarItems- menubar items to show- Returns:
- this instance
-
configureToolbar
Configures the toolbar of the editor instance to show the given items. Previous settings will be overridden. Passing nothing will hide the toolbar.- Parameters:
toolbarItems- toolbar items to show- Returns:
- this instance
-
configureResize
Configures the resize option for the editor. Please note, that there are additional settings to this instance necessary, so it is not recommended to call directly
configure("resize", ...).Please note, that this feature is a built-in feature of the HugeRTE and may lead to some issues with the wrapping Vaadin component regarding initial and continuous height settings. If you want to set an initial height or min-max height restrictions, it is strongly recommended to do that via the
setEditor...Heightmethods, NOT the normal ones.Also please note, that when you only set a min-max restriction, but no initial editor height, the editor will not be shown with its minimal height, but minimized. If you want to show it in its minimal or maximal state, apply the respective pixel value to
setEditorHeight(String).- Parameters:
direction- direction- Returns:
- this instance
- See Also:
-
setValueChangeMode
Sets the value change mode of this instance. By default the editor usesValueChangeMode.ON_CHANGE. Null resets the mode to the default.- Parameters:
valueChangeMode- new value change mode
-
getValueChangeMode
Returns the current value change mode. Never null.- Returns:
- value change mode
-
setValueChangeTimeout
public void setValueChangeTimeout(int timeoutInMilliseconds) -
getValueChangeTimeout
public int getValueChangeTimeout() -
replaceSelectionContent
-
setEditorHeight
This convenience method sets the editor height. The editor in this case is not the component itself, but a subset of its content. Basically everything except for the label, error- and helper text. So the component will always be a bit larger (for instance when you set a height of 600px, the component will have something like ~650px, depending on the used features).
This value cannot be changed, while the editor is attached. This is a limitation of the underlying editor engine.
Please note, that you may not need this method very often, but in edge cases only (e.g. when using the resizable functionality). Also ensure, that no normal height is set (i.e. remove the default height).
- Parameters:
editorHeight- editor height
-
setEditorHeight
public void setEditorHeight(int editorHeight) This convenience method sets the editor height in pixels. The editor in this case is not the component itself, but a subset of its content. Basically everything except for the label, error- and helper text. So the component will always be a bit larger (for instance when you set a height of 600px, the component will have something like ~650px, depending on the used features).
This value cannot be changed, while the editor is attached. This is a limitation of the underlying editor engine.
Please note, that you may not need this method very often, but in edge cases only (e.g. when using the resizable functionality).
- Parameters:
editorHeight- editor height
-
setEditorMinHeight
public void setEditorMinHeight(int editorMinHeight) This convenience method sets the editor minimal height in pixels.
The editor in this case is not the component itself, but a subset of its content. Basically everything except for the label, error- and helper text. So the component will always be a bit larger (for instance when you set a min height of 200px, the component still will be something like ~250px, depending on the used features).
This value cannot be changed, while the editor is attached. This is a limitation of the underlying editor engine.
Please note, that you may not need this method very often, but in edge cases only (e.g. when using the resizable functionality or auto resize plugin).
- Parameters:
editorMinHeight- editor minimal height
-
setEditorMaxHeight
public void setEditorMaxHeight(int editorMaxHeight) This convenience method sets the editor maximal height in pixels.
The editor in this case is not the component itself, but a subset of its content. Basically everything except for the label, error- and helper text. So the component will always be a bit larger (for instance when you set a max height of 600px, the component will still be something like ~650px, depending on the used features).
This value cannot be changed, while the editor is attached. This is a limitation of the underlying editor engine.
Please note, that you may not need this method very often, but in edge cases only (e.g. when using the resizable functionality or auto resize plugin).
- Parameters:
editorMaxHeight- editor maximal height
-