public interface JProTextInputControl
This interface can be implemented by a JavaFX
Node.
When an TextInputControl is used with JPro, in the Browser a hidden input field is used to capture the input.
Using this interface creates the same behavior in JavaFX without the need to extend TextInputControl.-
Property Summary
PropertiesTypePropertyDescriptionjavafx.beans.property.IntegerPropertyThe anchor of the selection.javafx.beans.property.IntegerPropertyProvides access to the caret position property.javafx.beans.property.ReadOnlyBooleanPropertyWhether the control is editable or not.javafx.beans.property.StringPropertyThe text that is displayed in the control.javafx.beans.property.StringPropertyThe text that is displayed in the control. -
Method Summary
Modifier and TypeMethodDescriptionjavafx.beans.property.IntegerPropertyThe anchor of the selection.javafx.beans.property.IntegerPropertyProvides access to the caret position property.javafx.beans.property.ReadOnlyBooleanPropertyWhether the control is editable or not.default intGets the position of the anchor in the text control.default intRetrieves the current position of the caret (cursor) in the text control.default StringgetText()Retrieves the current text from the text input control.default StringRetrieves the type of virtual keyboard that is used with this control.default booleanChecks if the text input control is editable.booleanDetermines whether the text input control is a TextArea.voidselectRange(int anchor, int caretPosition) Selects a range of text in the text input control.default voidsetAnchor(int anchor) Sets the position of the anchor in the text control.default voidsetCaretPosition(int caretPosition) Sets the position of the caret (cursor) in the text control.default voidSets the text in the text input control to the specified string.default voidSets the type of virtual keyboard to be used with this control.javafx.beans.property.StringPropertyThe text that is displayed in the control.javafx.beans.property.StringPropertyThe text that is displayed in the control.
-
Property Details
-
text
javafx.beans.property.StringProperty textPropertyThe text that is displayed in the control.- See Also:
-
vkType
javafx.beans.property.StringProperty vkTypePropertyThe text that is displayed in the control.- See Also:
-
anchor
javafx.beans.property.IntegerProperty anchorPropertyThe anchor of the selection.- See Also:
-
caretPosition
javafx.beans.property.IntegerProperty caretPositionPropertyProvides access to the caret position property. The caret position indicates the current position of the caret (cursor) within the text.- See Also:
-
editable
javafx.beans.property.ReadOnlyBooleanProperty editablePropertyWhether the control is editable or not.- See Also:
-
-
Method Details
-
isTextArea
boolean isTextArea()Determines whether the text input control is a TextArea.- Returns:
trueif the text input control is a TextArea,falseotherwise.
-
getText
Retrieves the current text from the text input control.- Returns:
- the current text as a String.
-
setText
Sets the text in the text input control to the specified string.- Parameters:
text- the new text to set in the control.
-
textProperty
javafx.beans.property.StringProperty textProperty()The text that is displayed in the control.- See Also:
-
getVkType
Retrieves the type of virtual keyboard that is used with this control.- Returns:
- the type of virtual keyboard as a String.
-
setVkType
Sets the type of virtual keyboard to be used with this control.- Parameters:
vkType- the type of virtual keyboard to set.
-
vkTypeProperty
javafx.beans.property.StringProperty vkTypeProperty()The text that is displayed in the control.- See Also:
-
getAnchor
default int getAnchor()Gets the position of the anchor in the text control. The anchor, together with the caret, defines the text selection.- Returns:
- the position of the anchor as an integer.
-
setAnchor
default void setAnchor(int anchor) Sets the position of the anchor in the text control. The anchor, v together with the caret, defines the text selection.- Parameters:
anchor- the new position of the anchor.
-
anchorProperty
javafx.beans.property.IntegerProperty anchorProperty()The anchor of the selection.- See Also:
-
getCaretPosition
default int getCaretPosition()Retrieves the current position of the caret (cursor) in the text control.- Returns:
- the current caret position as an integer.
-
setCaretPosition
default void setCaretPosition(int caretPosition) Sets the position of the caret (cursor) in the text control.- Parameters:
caretPosition- the new position of the caret.
-
caretPositionProperty
javafx.beans.property.IntegerProperty caretPositionProperty()Provides access to the caret position property. The caret position indicates the current position of the caret (cursor) within the text.- See Also:
-
isEditable
default boolean isEditable()Checks if the text input control is editable.- Returns:
trueif the control is editable,falseotherwise.
-
editableProperty
javafx.beans.property.ReadOnlyBooleanProperty editableProperty()Whether the control is editable or not.- See Also:
-
selectRange
void selectRange(int anchor, int caretPosition) Selects a range of text in the text input control. The range is specified by the anchor and caret position, where anchor defines the start of the selection and caretPosition defines the end of the selection.- Parameters:
anchor- the starting index of the text selection.caretPosition- the ending index of the text selection.
-