-
- All Superinterfaces:
ErrorPopupSupported,FxComponent,FxControl,InfoPopupSupported
- All Known Implementing Classes:
AbstractTextFieldDelegate,FxComboBox,FxComboBoxDelegate,FxDatePicker,FxDatePickerDelegate,FxHTMLEditor,FxHTMLEditorDelegate,FxPasswordField,FxPasswordFieldDelegate,FxTextArea,FxTextAreaDelegate,FxTextComponentDelegate,FxTextField,FxTextFieldDelegate
public interface FxTextComponent extends FxComponent
A text component.- Author:
- harald
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidautoSelect()Selects or deselects all text in the text input.CaseConversiongetCaseConversion()Gets the case conversion.intgetColumns()Gets the columns.java.lang.IntegergetErrorOffset()Gets the error offset.chargetFiller()Gets the filler character.java.lang.StringgetInvalidChars()Gets invalid characters.intgetMaxColumns()Gets the maximum number of columns.java.lang.StringgetPattern()Gets the format pattern.intgetScale()Gets the current scale.javafx.geometry.PosgetTextAlignment()Gets the text alignment.java.util.function.Function<java.lang.String,java.lang.String>getTextConverter()Gets the text converter.java.lang.StringgetValidChars()Gets allowed characters.booleanisAutoSelect()Returns whether the auto-select feature is enabled.booleanisLenient()Returns whether parsing to model should be lenient.booleanisUnsigned()Returns whether a numeric field is unsigned or signed.booleanisUTC()Returns whether this is a UTC timestamp.voidmapErrorOffsetToCaretPosition()Sets the caret position according to the error offset.
Does nothing if error offset is null.voidsetAutoSelect(boolean autoSelect)Sets the auto-select feature.
A component with autoselect enabled will automatically select all characters if the component gets the keyboard focus.voidsetCaseConversion(CaseConversion caseConversion)Sets the case conversion.voidsetColumns(int columns)Sets the number of columns in this component.
The visible width is adjusted according to the current font.voidsetErrorOffset(java.lang.Integer errorOffset)Sets the error offset.voidsetFiller(char filler)Sets the filler character.
The default is space.voidsetInvalidChars(java.lang.String invalidChars)Sets invalid characters.voidsetLenient(boolean lenient)Sets whether parsing to model should be lenient.voidsetMaxColumns(int maxColumns)Sets the maximum number of columns.
The number of columns will be enforced by the model.voidsetPattern(java.lang.String pattern)Sets the format pattern.
The format pattern is used to format the view of the data.voidsetScale(int scale)Changes the format according to the given scale.voidsetTextAlignment(javafx.geometry.Pos textAlignment)Sets the text alignment.voidsetTextConverter(java.util.function.Function<java.lang.String,java.lang.String> textConverter)Sets a text converter.
Converts input text to the view's text.voidsetUnsigned(boolean unsigned)Sets whether a numeric field is unsigned or signed.voidsetUTC(boolean utc)Sets whether this is a UTC timestamp.voidsetValidChars(java.lang.String validChars)Sets allowed characters.-
Methods inherited from interface org.tentackle.fx.ErrorPopupSupported
getError, hideErrorPopup, isErrorTemporary, setError, setErrorTemporary, showErrorPopup
-
Methods inherited from interface org.tentackle.fx.FxComponent
getBinding, getBindingPath, getComponentPath, getDelegate, getGenericType, getSavedViewObject, getTableCell, getType, getValueTranslator, getViewObject, getViewValue, isMandatory, isModelUpdated, isSavedViewObjectValid, mandatoryProperty, setBinding, setBindingPath, setComponentPath, setGenericType, setMandatory, setTableCell, setType, setValueTranslator, setViewObject, setViewValue
-
Methods inherited from interface org.tentackle.fx.FxControl
addModelToViewListener, addViewToModelListener, changeableProperty, getHelpUrl, getParentContainer, invalidateSavedView, isBindable, isChangeable, isContainerChangeableIgnored, isViewModified, removeModelToViewListener, removeViewToModelListener, saveView, setBindable, setChangeable, setContainerChangableIgnored, setContainerChangeable, setHelpUrl, setViewModified, showHelp, toGenericString, triggerViewModified, updateModel, updateView, viewModifiedProperty
-
Methods inherited from interface org.tentackle.fx.InfoPopupSupported
getInfo, hideInfoPopup, setInfo, showInfoPopup
-
-
-
-
Method Detail
-
getErrorOffset
java.lang.Integer getErrorOffset()
Gets the error offset.- Returns:
- the offset, null if no offset
-
setErrorOffset
void setErrorOffset(java.lang.Integer errorOffset)
Sets the error offset.- Parameters:
errorOffset- null to clear
-
mapErrorOffsetToCaretPosition
void mapErrorOffsetToCaretPosition()
Sets the caret position according to the error offset.
Does nothing if error offset is null.
-
setTextAlignment
void setTextAlignment(javafx.geometry.Pos textAlignment)
Sets the text alignment.- Parameters:
textAlignment- the alignment, null if component's default
-
getTextAlignment
javafx.geometry.Pos getTextAlignment()
Gets the text alignment.- Returns:
- the alignment, null if component's default
-
setColumns
void setColumns(int columns)
Sets the number of columns in this component.
The visible width is adjusted according to the current font.- Parameters:
columns- the number of columns ≥ 0
-
getColumns
int getColumns()
Gets the columns.- Returns:
- the columns
-
setMaxColumns
void setMaxColumns(int maxColumns)
Sets the maximum number of columns.
The number of columns will be enforced by the model.- Parameters:
maxColumns- the maximum number of columns, 0 if unlimited (default)
-
getMaxColumns
int getMaxColumns()
Gets the maximum number of columns.- Returns:
- the maximum number of columns, 0 if unlimited (default)
-
setAutoSelect
void setAutoSelect(boolean autoSelect)
Sets the auto-select feature.
A component with autoselect enabled will automatically select all characters if the component gets the keyboard focus. Useful for numerical fields, for example.- Parameters:
autoSelect- true if autoselect enabled, false if disabled (default)
-
isAutoSelect
boolean isAutoSelect()
Returns whether the auto-select feature is enabled.- Returns:
- true if autoselect enabled, false if disabled (default)
-
setPattern
void setPattern(java.lang.String pattern)
Sets the format pattern.
The format pattern is used to format the view of the data.- Parameters:
pattern- the format pattern
-
getPattern
java.lang.String getPattern()
Gets the format pattern.- Returns:
- the format pattern
-
isLenient
boolean isLenient()
Returns whether parsing to model should be lenient.- Returns:
- true if lenient, false is default
-
setLenient
void setLenient(boolean lenient)
Sets whether parsing to model should be lenient.- Parameters:
lenient- true if lenient
-
setScale
void setScale(int scale)
Changes the format according to the given scale.- Parameters:
scale- the number of digits after the comma
-
getScale
int getScale()
Gets the current scale.- Returns:
- the scale
-
setUnsigned
void setUnsigned(boolean unsigned)
Sets whether a numeric field is unsigned or signed.- Parameters:
unsigned- true if unsigned
-
isUnsigned
boolean isUnsigned()
Returns whether a numeric field is unsigned or signed.- Returns:
- true if unsigned
-
setUTC
void setUTC(boolean utc)
Sets whether this is a UTC timestamp.- Parameters:
utc- true if UTC
-
isUTC
boolean isUTC()
Returns whether this is a UTC timestamp.- Returns:
- true if UTC
-
setCaseConversion
void setCaseConversion(CaseConversion caseConversion)
Sets the case conversion.- Parameters:
caseConversion- the conversion, null if no conversion (default)
-
getCaseConversion
CaseConversion getCaseConversion()
Gets the case conversion.- Returns:
- the conversion, null if no conversion (default)
-
setFiller
void setFiller(char filler)
Sets the filler character.
The default is space.- Parameters:
filler- the filler
-
getFiller
char getFiller()
Gets the filler character.- Returns:
- the filler
-
setValidChars
void setValidChars(java.lang.String validChars)
Sets allowed characters.- Parameters:
validChars- the valid characters, null = all (default)
-
getValidChars
java.lang.String getValidChars()
Gets allowed characters.- Returns:
- the valid characters, null = all (default)
-
setInvalidChars
void setInvalidChars(java.lang.String invalidChars)
Sets invalid characters.- Parameters:
invalidChars- the invalid characters, null = none (default)
-
getInvalidChars
java.lang.String getInvalidChars()
Gets invalid characters.- Returns:
- the invalid characters, null = none (default)
-
setTextConverter
void setTextConverter(java.util.function.Function<java.lang.String,java.lang.String> textConverter)
Sets a text converter.
Converts input text to the view's text.- Parameters:
textConverter- the converter
-
getTextConverter
java.util.function.Function<java.lang.String,java.lang.String> getTextConverter()
Gets the text converter.- Returns:
- the converter
-
autoSelect
void autoSelect()
Selects or deselects all text in the text input.- See Also:
isAutoSelect()
-
-