@Tag(value="super-text-field")
@JsModule(value="./super-text-field.js")
@CssImport(value="./styles/label-positions.css",
themeFor="super-text-field")
public class SuperTextField
extends com.vaadin.flow.component.textfield.TextField
implements CanSelectText, TextSelectionNotifier<SuperTextField>, CanModifyText, WithRequiredMixin<SuperTextField>, WithLabelPositionableMixin<SuperTextField>, WithIdMixin<SuperTextField>, WithLabelMixin<SuperTextField>, WithPlaceholderMixin<SuperTextField>, WithValueMixin<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.textfield.TextField,String>,String,SuperTextField>, WithHelperMixin<SuperTextField>, WithHelperPositionableMixin<SuperTextField>, WithReceivingSelectionEventsFromClientMixin<SuperTextField>, WithClearButtonMixin<SuperTextField>, WithTooltipMixin<SuperTextField>, WithTextInputModeMixin<SuperTextField>, WithInvalidInputPreventionMixin<SuperTextField>
TextField with some useful (hopefully) features.com.vaadin.flow.component.textfield.GeneratedVaadinTextField.ChangeEvent<R extends com.vaadin.flow.component.textfield.GeneratedVaadinTextField<R,?>>, com.vaadin.flow.component.textfield.GeneratedVaadinTextField.InvalidChangeEvent<R extends com.vaadin.flow.component.textfield.GeneratedVaadinTextField<R,?>>com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<C extends com.vaadin.flow.component.Component,V>com.vaadin.flow.component.HasValue.ValueChangeEvent<V>, com.vaadin.flow.component.HasValue.ValueChangeListener<E extends com.vaadin.flow.component.HasValue.ValueChangeEvent<?>>com.vaadin.flow.component.shared.HasClientValidation.ClientValidatedEventLABEL_POSITION_ATTRIBUTE, LABEL_POSITION_DETAILS_ATTRIBUTEHELPER_ABOVE_THEME_VARIANTDEFAULT_CHANGE_TIMEOUTAUTOCOMPLETE_ATTRIBUTE| Constructor and Description |
|---|
SuperTextField() |
SuperTextField(com.vaadin.flow.component.HasValue.ValueChangeListener<? super com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.textfield.TextField,String>> listener) |
SuperTextField(String label) |
SuperTextField(String label,
com.vaadin.flow.component.HasValue.ValueChangeListener<? super com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.textfield.TextField,String>> listener) |
SuperTextField(String label,
String placeholder) |
SuperTextField(String label,
String initialValue,
com.vaadin.flow.component.HasValue.ValueChangeListener<? super com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.textfield.TextField,String>> listener) |
SuperTextField(String label,
String initialValue,
String placeholder) |
| Modifier and Type | Method and Description |
|---|---|
com.vaadin.flow.shared.Registration |
addTextSelectionListener(TextSelectionListener<SuperTextField> listener)
Adds the listener.
|
TextInputMode |
getTextInputMode()
Returns the current text input mode of this object.
|
String |
getTooltipText() |
boolean |
isClearButtonVisible()
Checks if the clear button is currently visible.
|
boolean |
isPreventingInvalidInput()
Checks if this component is actively preventing invalid input.
|
boolean |
isReceivingSelectionEventsFromClient()
Check if client will inform server on selection change.
|
void |
modifyText(String replacement,
int from,
int to)
Modifies the text at given coordinates.
|
protected void |
onAttach(com.vaadin.flow.component.AttachEvent attachEvent) |
protected void |
onDetach(com.vaadin.flow.component.DetachEvent detachEvent) |
void |
select(int from,
int to)
Selects text starting from index
from (inclusive) and ending at index to (exclusive). |
void |
selectAll()
Selects entire text in the component.
|
void |
selectNone()
Removes the current selection and selects no text.
|
void |
setClearButtonVisible(boolean clearButtonVisible)
Sets the visibility of the clear button.
|
void |
setPreventingInvalidInput(boolean prevent)
Modifies the state of the component when it comes to preventing invalid input.
|
void |
setReceivingSelectionEventsFromClient(boolean receivingSelectionEventsFromClient)
Configures sending events by the client-side component.
|
void |
setTextInputMode(TextInputMode inputMode)
Changes the text input mode of this object.
|
void |
setTooltipText(String tooltipText) |
addValidationStatusChangeListener, getDefaultValidator, getEmptyValue, getErrorMessage, getLabel, getMaxLength, getMinLength, getPattern, getPlaceholder, getTitle, getValue, getValueChangeMode, getValueChangeTimeout, isAutofocus, isAutoselect, isEnforcedFieldValidationEnabled, isInvalid, isPreventInvalidInput, isRequired, setAutofocus, setAutoselect, setErrorMessage, setInvalid, setLabel, setMaxLength, setMinLength, setPattern, setPlaceholder, setPreventInvalidInput, setRequired, setRequiredIndicatorVisible, setTitle, setValue, setValueChangeMode, setValueChangeTimeout, validateaddChangeListener, addInvalidChangeListener, addThemeVariants, addToInput, addToPrefix, addToSuffix, checkValidity, getAutocapitalizeString, getAutocompleteString, getAutocorrectString, getErrorMessageString, getLabelString, getListString, getMaxlengthDouble, getMinlengthDouble, getNameString, getPatternString, getPlaceholderString, getTitleString, isAutofocusBoolean, isAutoselectBoolean, isClearButtonVisibleBoolean, isDisabledBoolean, isInvalidBoolean, isPreventInvalidInputBoolean, isReadonlyBoolean, isRequiredBoolean, remove, removeAll, removeThemeVariants, setAutocapitalize, setAutocomplete, setAutocorrect, setDisabled, setList, setMaxlength, setMinlength, setName, setReadonlygetSynchronizationRegistration, hasValidValue, setPresentationValue, setSynchronizedEventaddValueChangeListener, isEmpty, setModelValue, valueEqualsaddListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onEnabledStateChanged, set, setElement, setId, setVisibleclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitmodifyText, modifyTextwithoutRequired, withRequired, withRequiredisRequired, setRequiredwithLabelPositiongetLabelPosition, setLabelPositionwithIdwithLabelwithPlaceholdergetPlaceholder, setPlaceholderwithValueaddValueChangeListener, clear, getEmptyValue, getOptionalValue, getValue, isEmpty, isReadOnly, isRequiredIndicatorVisible, setReadOnly, setRequiredIndicatorVisible, setValuewithHelperComponent, withHelperTextgetHelperComponent, getHelperText, setHelperComponent, setHelperTextwithHelperAbove, withHelperAbove, withHelperBelowisHelperAbove, setHelperAbove, setHelperAbove, setHelperBelowwithoutReceivingSelectionEventsFromClient, withReceivingSelectionEventsFromClient, withReceivingSelectionEventsFromClientwithClearButtonVisible, withClearButtonVisible, withoutClearButtonVisiblewithTooltipTextwithTextInputModewithoutPreventingInvalidInput, withPreventingInvalidInput, withPreventingInvalidInputgetCssSize, getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFullgetPrefixComponent, getSuffixComponent, setPrefixComponent, setSuffixComponentaddKeyDownListener, addKeyDownListener, addKeyPressListener, addKeyPressListener, addKeyUpListener, addKeyUpListeneraddCompositionEndListener, addCompositionStartListener, addCompositionUpdateListenergetAutocomplete, setAutocompletegetAutocapitalize, setAutocapitalizeisAutocorrect, setAutocorrectaddClientValidatedEventListeneraddClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameaddFocusShortcut, blur, focus, getTabIndex, setTabIndexaddThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeNamepublic SuperTextField()
public SuperTextField(String label)
public SuperTextField(com.vaadin.flow.component.HasValue.ValueChangeListener<? super com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.textfield.TextField,String>> listener)
public SuperTextField(String label, com.vaadin.flow.component.HasValue.ValueChangeListener<? super com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.textfield.TextField,String>> listener)
protected void onAttach(com.vaadin.flow.component.AttachEvent attachEvent)
onAttach in class com.vaadin.flow.component.textfield.TextFieldprotected void onDetach(com.vaadin.flow.component.DetachEvent detachEvent)
onDetach in class com.vaadin.flow.component.Componentpublic com.vaadin.flow.shared.Registration addTextSelectionListener(TextSelectionListener<SuperTextField> listener)
TextSelectionNotifieraddTextSelectionListener in interface TextSelectionNotifier<SuperTextField>listener - A listener to add.Registration that can be used to stop listening to the event.public void selectAll()
CanSelectTextselectAll in interface CanSelectTextpublic void selectNone()
CanSelectTextselectNone in interface CanSelectTextpublic void select(int from,
int to)
CanSelectTextfrom (inclusive) and ending at index to (exclusive).select in interface CanSelectTextfrom - Starting index (inclusive).to - Ending index (exclusive).public boolean isReceivingSelectionEventsFromClient()
CanReceiveSelectionEventsFromClientisReceivingSelectionEventsFromClient in interface CanReceiveSelectionEventsFromClienttrue, each selection change in the client-side component will result in this component broadcasting a TextSelectionEvent.public void setReceivingSelectionEventsFromClient(boolean receivingSelectionEventsFromClient)
CanReceiveSelectionEventsFromClientsetReceivingSelectionEventsFromClient in interface CanReceiveSelectionEventsFromClientreceivingSelectionEventsFromClient - When false, selecting text in client-side component will not send an event to server-side component. When true, it will.public void modifyText(String replacement, int from, int to)
CanModifyTextmodifyText in interface CanModifyTextreplacement - Text to put.from - The starting index of what to replace.to - The end index of what to replace.public void setTextInputMode(TextInputMode inputMode)
HasTextInputModesetTextInputMode in interface HasTextInputModeinputMode - New input mode. Can be null.public TextInputMode getTextInputMode()
HasTextInputModegetTextInputMode in interface HasTextInputModeTextInputMode, or null if none has been set.public void setPreventingInvalidInput(boolean prevent)
HasInvalidInputPreventiontrue and the current value is invalid, it will be cleared.setPreventingInvalidInput in interface HasInvalidInputPreventionprevent - Whether to prevent invalid input.public boolean isPreventingInvalidInput()
HasInvalidInputPreventionisPreventingInvalidInput in interface HasInvalidInputPreventiontrue when entering invalid input is prevented, false otherwise and by default.public void setClearButtonVisible(boolean clearButtonVisible)
HasClearButtonsetClearButtonVisible in interface HasClearButtonsetClearButtonVisible in class com.vaadin.flow.component.textfield.TextFieldclearButtonVisible - New state.public boolean isClearButtonVisible()
HasClearButtonisClearButtonVisible in interface HasClearButtonisClearButtonVisible in class com.vaadin.flow.component.textfield.TextFieldpublic void setTooltipText(String tooltipText)
setTooltipText in interface HasTooltippublic String getTooltipText()
getTooltipText in interface HasTooltipCopyright © 2023 Miki. All rights reserved.