public abstract class AbstractTextArea<T extends com.vaadin.ui.TextArea,V> extends AbstractField<T,java.lang.String,V> implements TextArea<V>
TextInputField.CaseConversion, TextInputField.CaseConversionSupported, TextInputField.CursorPositionSupported, TextInputField.EnterPressEvent, TextInputField.EnterPressNotifier, TextInputField.HtmlNameSupported, TextInputField.MaxLengthLimited, TextInputField.TextChangeEvent, TextInputField.TextChangeEventMode, TextInputField.TextChangeNotifier, TextInputField.TextSelectionSupported, TextInputField.TrimSupported
HasValue.ValueChangeEvent<V>
Component.Alignment, Component.BelongToFrame, Component.Disposable, Component.Editable, Component.Focusable, Component.HasCaption, Component.HasDescription, Component.HasIcon, Component.HasXmlDescriptor, Component.Wrapper
HasContextHelp.ContextHelpIconClickEvent
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
conversionErrorMessage |
protected DataAwareComponentsTools |
dataAwareComponentsTools |
protected io.jmix.core.metamodel.datatype.Datatype<V> |
datatype |
protected java.util.Locale |
locale |
protected boolean |
trimming |
editable, parentEditableChangeListener, validators, VALIDATORS_LIST_INITIAL_CAPACITY
internalValue, uiTestIdsSupport, valueBinding
alignment, applicationContext, component, contextHelpIconClickHandler, contextHelpIconClickListener, descriptionAsHtml, element, frame, htmlSanitizerEnabled, icon, ICON_STYLE, id, parent
NAME, TYPE_BIGDECIMAL, TYPE_DATE, TYPE_DATETIME, TYPE_DEFAULT, TYPE_DOUBLE, TYPE_INTEGER, TYPE_LOCALDATE, TYPE_LOCALDATETIME, TYPE_LONG, TYPE_OFFSETTIME, TYPE_STRING, TYPE_TIME
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE
Constructor and Description |
---|
AbstractTextArea() |
Modifier and Type | Method and Description |
---|---|
io.jmix.core.common.event.Subscription |
addTextChangeListener(java.util.function.Consumer<TextInputField.TextChangeEvent> listener)
Adds a listener that is fired when the component value is changed.
|
void |
commit()
Updates all changes since the previous commit to the data source.
|
protected void |
componentValueChanged(java.lang.String prevComponentValue,
java.lang.String newComponentValue,
boolean isUserOriginated) |
protected V |
convertToModel(java.lang.String componentRawValue) |
protected java.lang.String |
convertToPresentation(V modelValue) |
void |
discard()
Discards all changes since last commit.
|
protected void |
fireTextChangeEvent(java.lang.String newComponentValue) |
void |
focus()
Sets focus to this component
|
java.lang.String |
getConversionErrorMessage() |
protected java.lang.String |
getConversionErrorMessageInternal() |
io.jmix.core.metamodel.datatype.Datatype<V> |
getDatatype() |
java.lang.String |
getInputPrompt() |
int |
getMaxLength() |
java.lang.String |
getRawValue()
Returns a string representation of the value.
|
int |
getRows() |
int |
getTabIndex()
Gets the tabulator index of the
HasTabIndex component. |
TextInputField.TextChangeEventMode |
getTextChangeEventMode() |
int |
getTextChangeTimeout()
Gets the timeout used to fire
TextInputField.TextChangeEvent s and ValueChangeEvent s when the
TextInputField.TextChangeNotifier.getTextChangeEventMode() is TextInputField.TextChangeEventMode.LAZY or
TextInputField.TextChangeEventMode.TIMEOUT . |
boolean |
isBuffered() |
boolean |
isEmpty() |
boolean |
isModified()
Tests if the value stored in the object has been modified since it was
last updated from the data source.
|
boolean |
isTrimming() |
boolean |
isWordWrap() |
void |
selectAll() |
void |
setBuffered(boolean buffered)
Sets the buffered mode.
|
void |
setConversionErrorMessage(java.lang.String conversionErrorMessage)
Sets custom conversion error message that is used when value doesn't correspond to datatype.
|
void |
setCurrentAuthentication(io.jmix.core.security.CurrentAuthentication currentAuthentication) |
void |
setCursorPosition(int position)
Sets the cursor position in the field.
|
void |
setDataAwareComponentsTools(DataAwareComponentsTools dataAwareComponentsTools) |
void |
setDatatype(io.jmix.core.metamodel.datatype.Datatype<V> datatype)
Sets the given
datatype to the component. |
void |
setInputPrompt(java.lang.String inputPrompt)
Sets the input prompt - a textual prompt that is displayed when the field
would otherwise be empty, to prompt the user for input.
|
void |
setMaxLength(int value) |
void |
setRows(int rows)
Sets the number of rows in the text area.
|
void |
setSelectionRange(int pos,
int length) |
void |
setTabIndex(int tabIndex)
Sets the tabulator index of the
Focusable component. |
void |
setTextChangeEventMode(TextInputField.TextChangeEventMode mode)
Sets the mode how the TextField triggers
TextInputField.TextChangeEvent s and ValueChangeEvent s. |
void |
setTextChangeTimeout(int timeout)
The text change timeout modifies how often text change events are
communicated to the application when
TextInputField.TextChangeNotifier.getTextChangeEventMode() is
TextInputField.TextChangeEventMode.LAZY or TextInputField.TextChangeEventMode.TIMEOUT . |
void |
setTrimming(boolean trimming) |
void |
setWordWrap(boolean wordWrap)
Sets whether word wrapping is enabled or not.
|
protected void |
valueBindingConnected(ValueSource<V> valueSource) |
addValidator, attachValueChangeListener, getDatatypeConversionErrorMsg, getErrorMessage, getRequiredMessage, getValidators, isEditable, isRequired, isValid, removeValidator, setEditable, setEditableToComponent, setParent, setRequired, setRequiredMessage, setupComponentErrorProvider, triggerValidators, validate
addValueChangeListener, fieldValueEquals, getValue, getValueSource, setUiTestId, setUiTestIdsSupport, setValue, setValueSource, setValueToPresentation, valueBindingActivated
addAttachListener, addDetachListener, addStyleName, assignDebugId, attached, detached, getAlignment, getCaption, getComponent, getComposition, getContextHelpIconClickHandler, getContextHelpText, getDebugId, getDescription, getEventHub, getFrame, getHeight, getHeightSizeUnit, getHtmlSanitizer, getIcon, getIconName, getIconResource, getId, getParent, getStyleName, getUiComponentProperties, getUiProperties, getWidth, getWidthSizeUnit, getXmlDescriptor, hasSubscriptions, hasValidationError, isAttached, isCaptionAsHtml, isContextHelpTextHtmlEnabled, isDescriptionAsHtml, isEnabled, isEnabledRecursive, isHtmlSanitizerEnabled, isResponsive, isVisible, isVisibleRecursive, onContextHelpIconClick, publish, removeStyleName, sanitize, setAlignment, setApplicationContext, setCaption, setCaptionAsHtml, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabled, setDebugId, setDescription, setDescriptionAsHtml, setEnabled, setFrame, setHeight, setHtmlSanitizerEnabled, setIcon, setIconFromSet, setId, setResponsive, setStyleName, setValidationError, setVisible, setWidth, setXmlDescriptor, unsubscribe, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, withUnwrapped, withUnwrappedComposition
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getValueSource, setValueSource
addValueChangeListener, clear, getEmptyValue, getValue, setValue
isEditable, isEditableWithParent, setEditable
getFrame, setFrame
addStyleName, getAlignment, getHeight, getHeightSizeUnit, getId, getParent, getStyleName, getWidth, getWidthSizeUnit, isEnabled, isEnabledRecursive, isResponsive, isVisible, isVisibleRecursive, removeStyleName, setAlignment, setEnabled, setHeight, setHeightAuto, setHeightFull, setId, setParent, setResponsive, setSizeAuto, setSizeFull, setStyleName, setVisible, setWidth, setWidthAuto, setWidthFull, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, withUnwrapped, withUnwrappedComposition
isValid, isValidateOnCommit, validate
getIcon, setIcon, setIconFromSet
getContextHelpIconClickHandler, getContextHelpText, isContextHelpTextHtmlEnabled, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabled
isCaptionAsHtml, setCaptionAsHtml
getCaption, setCaption
getDescription, setDescription
isDescriptionAsHtml, setDescriptionAsHtml
isHtmlSanitizerEnabled, setHtmlSanitizerEnabled
addValidator, addValidators, getValidators, removeValidator
getRequiredMessage, isRequired, setRequired, setRequiredMessage
isFocusable, setFocusable
getCaseConversion, setCaseConversion
protected io.jmix.core.metamodel.datatype.Datatype<V> datatype
protected java.util.Locale locale
protected boolean trimming
protected java.lang.String conversionErrorMessage
protected DataAwareComponentsTools dataAwareComponentsTools
@Autowired public void setDataAwareComponentsTools(DataAwareComponentsTools dataAwareComponentsTools)
public void focus()
Component.Focusable
focus
in interface Component.Focusable
protected java.lang.String convertToPresentation(@Nullable V modelValue) throws ConversionException
convertToPresentation
in class AbstractValueComponent<T extends com.vaadin.ui.TextArea,java.lang.String,V>
ConversionException
@Nullable protected V convertToModel(@Nullable java.lang.String componentRawValue) throws ConversionException
convertToModel
in class AbstractValueComponent<T extends com.vaadin.ui.TextArea,java.lang.String,V>
ConversionException
public void setConversionErrorMessage(@Nullable java.lang.String conversionErrorMessage)
HasConversionErrorMessage
setConversionErrorMessage
in interface HasConversionErrorMessage
conversionErrorMessage
- custom conversion error message@Nullable public java.lang.String getConversionErrorMessage()
getConversionErrorMessage
in interface HasConversionErrorMessage
protected java.lang.String getConversionErrorMessageInternal()
@Autowired public void setCurrentAuthentication(io.jmix.core.security.CurrentAuthentication currentAuthentication)
protected void componentValueChanged(java.lang.String prevComponentValue, java.lang.String newComponentValue, boolean isUserOriginated)
componentValueChanged
in class AbstractValueComponent<T extends com.vaadin.ui.TextArea,java.lang.String,V>
protected void fireTextChangeEvent(java.lang.String newComponentValue)
public io.jmix.core.common.event.Subscription addTextChangeListener(java.util.function.Consumer<TextInputField.TextChangeEvent> listener)
TextInputField.TextChangeNotifier
addTextChangeListener
in interface TextInputField.TextChangeNotifier
listener
- a listener to addSubscription
objectpublic int getMaxLength()
getMaxLength
in interface TextInputField.MaxLengthLimited
public void setMaxLength(int value)
setMaxLength
in interface TextInputField.MaxLengthLimited
public int getRows()
public void setRows(int rows)
TextArea
public boolean isWordWrap()
isWordWrap
in interface TextArea<V>
public void setWordWrap(boolean wordWrap)
TextArea
setWordWrap
in interface TextArea<V>
wordWrap
- wordWrap@Nullable public io.jmix.core.metamodel.datatype.Datatype<V> getDatatype()
getDatatype
in interface HasDatatype<V>
public void setDatatype(io.jmix.core.metamodel.datatype.Datatype<V> datatype)
HasDatatype
datatype
to the component. Its value will be formatted according to this
datatype.setDatatype
in interface HasDatatype<V>
datatype
- Datatype
instancepublic java.lang.String getRawValue()
TextArea
getRawValue
in interface TextArea<V>
public boolean isTrimming()
isTrimming
in interface TextInputField.TrimSupported
public void setTrimming(boolean trimming)
setTrimming
in interface TextInputField.TrimSupported
public int getTabIndex()
Component.Focusable
HasTabIndex
component.getTabIndex
in interface Component.Focusable
HasTabIndex
componentpublic void setTabIndex(int tabIndex)
Component.Focusable
Focusable
component.
The tab index property is used to specify the order in which the
fields are focused when the user presses the Tab key. Components with
a defined tab index are focused sequentially first, and then the
components with no tab index.setTabIndex
in interface Component.Focusable
tabIndex
- tab indexpublic void commit()
Buffered
public void discard()
Buffered
public boolean isBuffered()
isBuffered
in interface Buffered
isBuffered
in class AbstractValueComponent<T extends com.vaadin.ui.TextArea,java.lang.String,V>
true
if buffered mode is on, false
otherwisepublic void setBuffered(boolean buffered)
Buffered
When in buffered mode, an internal buffer will be used to store changes
until Buffered.commit()
is called. Calling Buffered.discard()
will revert
the internal buffer to the value of the data source.
When in non-buffered mode both read and write operations will be done
directly on the data source. In this mode the Buffered.commit()
and
Buffered.discard()
methods serve no purpose.
setBuffered
in interface Buffered
setBuffered
in class AbstractValueComponent<T extends com.vaadin.ui.TextArea,java.lang.String,V>
buffered
- true
if buffered mode should be turned on, false
otherwisepublic boolean isModified()
Buffered
isModified
in interface Buffered
isModified
in class AbstractValueComponent<T extends com.vaadin.ui.TextArea,java.lang.String,V>
true
if the value in the object has been modified
since the last data source update, false
if not.@Nullable public java.lang.String getInputPrompt()
getInputPrompt
in interface HasInputPrompt
public void setInputPrompt(@Nullable java.lang.String inputPrompt)
HasInputPrompt
setInputPrompt
in interface HasInputPrompt
inputPrompt
- input promptpublic void setCursorPosition(int position)
TextInputField.CursorPositionSupported
setCursorPosition
in interface TextInputField.CursorPositionSupported
position
- new cursor positionpublic void selectAll()
selectAll
in interface TextInputField.TextSelectionSupported
public void setSelectionRange(int pos, int length)
setSelectionRange
in interface TextInputField.TextSelectionSupported
public void setTextChangeTimeout(int timeout)
TextInputField.TextChangeNotifier
TextInputField.TextChangeNotifier.getTextChangeEventMode()
is
TextInputField.TextChangeEventMode.LAZY
or TextInputField.TextChangeEventMode.TIMEOUT
.setTextChangeTimeout
in interface TextInputField.TextChangeNotifier
timeout
- timeout in millisecondspublic int getTextChangeTimeout()
TextInputField.TextChangeNotifier
TextInputField.TextChangeEvent
s and ValueChangeEvent
s when the
TextInputField.TextChangeNotifier.getTextChangeEventMode()
is TextInputField.TextChangeEventMode.LAZY
or
TextInputField.TextChangeEventMode.TIMEOUT
.getTextChangeTimeout
in interface TextInputField.TextChangeNotifier
public TextInputField.TextChangeEventMode getTextChangeEventMode()
getTextChangeEventMode
in interface TextInputField.TextChangeNotifier
TextInputField.TextChangeEvent
s and ValueChangeEvent
s.public void setTextChangeEventMode(TextInputField.TextChangeEventMode mode)
TextInputField.TextChangeNotifier
TextInputField.TextChangeEvent
s and ValueChangeEvent
s.setTextChangeEventMode
in interface TextInputField.TextChangeNotifier
mode
- the new modeprotected void valueBindingConnected(ValueSource<V> valueSource)
valueBindingConnected
in class AbstractValueComponent<T extends com.vaadin.ui.TextArea,java.lang.String,V>