Class TextInputControl
java.lang.Object
javafx.scene.Node
javafx.scene.Parent
javafx.scene.layout.Region
javafx.scene.control.Control
javafx.scene.control.TextInputControl
- All Implemented Interfaces:
- Styleable,- EventTarget,- Skinnable
Abstract base class for text input controls.
- Since:
- JavaFX 2.0
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionprotected static interfaceInterface representing a text input's content.
- 
Property SummaryPropertiesTypePropertyDescriptionfinal ReadOnlyIntegerPropertyTheanchorof the text selection.final ReadOnlyIntegerPropertyThe current position of the caret within the text.final BooleanPropertyIndicates whether this TextInputControl can be edited by the user.final ObjectProperty<Font> The default font to use for text in the TextInputControl.final ReadOnlyIntegerPropertyThe number of characters in the text input.final StringPropertyThe prompt text to display in theTextInputControl.final ReadOnlyBooleanPropertyThe property describes if it's currently possible to redo the latest change of the content that was undone.final ReadOnlyStringPropertyDefines the characters in the TextInputControl which are selectedfinal ReadOnlyObjectProperty<IndexRange> The current selection.final ObjectProperty<TextFormatter<?>> The property contains currently attachedTextFormatter.final StringPropertyThe textual content of this TextInputControl.final ReadOnlyBooleanPropertyThe property describes if it's currently possible to undo the latest change of the content that was done.Properties declared in class javafx.scene.control.ControlcontextMenu, skin, tooltipProperties declared in class javafx.scene.layout.Regionbackground, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, widthProperties declared in class javafx.scene.ParentneedsLayoutProperties declared in class javafx.scene.NodeaccessibleHelp, accessibleRoleDescription, accessibleRole, accessibleText, blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, focusVisible, focusWithin, hover, id, inputMethodRequests, layoutBounds, layoutX, layoutY, localToParentTransform, localToSceneTransform, managed, mouseTransparent, nodeOrientation, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onInputMethodTextChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragEntered, onMouseDragExited, onMouseDragged, onMouseDragOver, onMouseDragReleased, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onRotate, onRotationFinished, onRotationStarted, onScrollFinished, onScroll, onScrollStarted, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, onZoomFinished, onZoom, onZoomStarted, opacity, parent, pickOnBounds, pressed, rotate, rotationAxis, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, translateZ, viewOrder, visible
- 
Field SummaryFields declared in class javafx.scene.layout.RegionUSE_COMPUTED_SIZE, USE_PREF_SIZEFields declared in class javafx.scene.NodeBASELINE_OFFSET_SAME_AS_HEIGHT
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedTextInputControl(TextInputControl.Content content) Creates a new TextInputControl.
- 
Method SummaryModifier and TypeMethodDescriptionfinal ReadOnlyIntegerPropertyTheanchorof the text selection.voidappendText(String text) Appends a sequence of characters to the content.voidbackward()Moves the caret position backward.final voidIf the field is currently being edited, this call will set text to the last committed value.final ReadOnlyIntegerPropertyThe current position of the caret within the text.voidclear()Clears the text.final voidCommit the current text and convert it to a value.voidcopy()Transfers the currently selected range in the text to the clipboard, leaving the current selection.voidcut()Transfers the currently selected range in the text to the clipboard, removing the current selection.booleanDeletes the character that follows the current caret position from the text if there is no selection, or deletes the selection if there is one.booleanDeletes the character that precedes the current caret position from the text if there is no selection, or deletes the selection if there is one.voiddeleteText(int start, int end) Removes a range of characters from the content.voiddeleteText(IndexRange range) Removes a range of characters from the content.voiddeselect()Clears the selection.final BooleanPropertyIndicates whether this TextInputControl can be edited by the user.voidend()Moves the caret to after the last char of the text.voidMoves the caret to the end of the next word.voidextendSelection(int pos) This function will extend the selection to include the specified pos.final ObjectProperty<Font> The default font to use for text in the TextInputControl.voidforward()Moves the caret position forward.final intGets the value of theanchorproperty.final intGets the value of thecaretPositionproperty.static List<CssMetaData<? extends Styleable, ?>> Gets theCssMetaDataassociated with this class, which may include theCssMetaDataof its superclasses.protected final TextInputControl.ContentReturns the text input's content model.List<CssMetaData<? extends Styleable, ?>> Gets the unmodifiable list of the control's CSS-styleable properties.final FontgetFont()Gets the value of thefontproperty.final intGets the value of thelengthproperty.final StringGets the value of thepromptTextproperty.final StringGets the value of theselectedTextproperty.final IndexRangeGets the value of theselectionproperty.final StringgetText()Gets the value of thetextproperty.getText(int start, int end) Returns a subset of the text input's content.final TextFormatter<?> Gets the value of thetextFormatterproperty.voidhome()Moves the caret to before the first char of the text.voidinsertText(int index, String text) Inserts a sequence of characters into the content.final booleanGets the value of theeditableproperty.final booleanGets the value of theredoableproperty.final booleanGets the value of theundoableproperty.final ReadOnlyIntegerPropertyThe number of characters in the text input.voidnextWord()Moves the caret to the beginning of next word.voidpaste()Transfers the contents in the clipboard into this text, replacing the current selection.voidpositionCaret(int pos) Positions the caret to the position indicated bypos.voidMoves the caret to the beginning of previous word.final StringPropertyThe prompt text to display in theTextInputControl.final voidredo()If possible, redoes the last undone modification.final ReadOnlyBooleanPropertyThe property describes if it's currently possible to redo the latest change of the content that was undone.voidreplaceSelection(String replacement) Replaces the selection with the given replacement String.voidreplaceText(int start, int end, String text) Replaces a range of characters with the given text.voidreplaceText(IndexRange range, String text) Replaces a range of characters with the given text.voidSelects all text in the text input.voidMoves the selection backward one char in the text.final ReadOnlyStringPropertyDefines the characters in the TextInputControl which are selectedvoidMoves the caret to after the last char of text.voidMoves the caret to the end of the next word.voidMoves the selection forward one char in the text.voidMoves the caret to before the first char of text.final ReadOnlyObjectProperty<IndexRange> The current selection.voidMoves the caret to the beginning of next word.voidselectPositionCaret(int pos) Positions the caret to the position indicated byposand extends the selection, if there is one.voidMoves the caret to the beginning of previous word.voidselectRange(int anchor, int caretPosition) Positions the anchor and caretPosition explicitly.final voidsetEditable(boolean value) Sets the value of theeditableproperty.final voidSets the value of thefontproperty.final voidsetPromptText(String value) Sets the value of thepromptTextproperty.final voidSets the value of thetextproperty.final voidsetTextFormatter(TextFormatter<?> value) Sets the value of thetextFormatterproperty.final ObjectProperty<TextFormatter<?>> The property contains currently attachedTextFormatter.final StringPropertyThe textual content of this TextInputControl.final voidundo()If possible, undoes the last modification.final ReadOnlyBooleanPropertyThe property describes if it's currently possible to undo the latest change of the content that was done.Methods declared in class javafx.scene.control.ControlcomputeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, contextMenuProperty, createDefaultSkin, getContextMenu, getCssMetaData, getInitialFocusTraversable, getSkin, getTooltip, isResizable, setContextMenu, setSkin, setTooltip, skinProperty, tooltipPropertyMethods declared in class javafx.scene.layout.RegionbackgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, computePrefHeight, computePrefWidth, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, isScaleShape, isSnapToPixel, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, opaqueInsetsProperty, paddingProperty, positionInArea, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, scaleShapeProperty, setBackground, setBorder, setCacheShape, setCenterShape, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setOpaqueInsets, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setScaleShape, setShape, setSnapToPixel, setWidth, shapeProperty, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, snapToPixelProperty, widthPropertyMethods declared in class javafx.scene.ParentgetBaselineOffset, getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, layoutChildren, needsLayoutProperty, requestLayout, requestParentLayout, setNeedsLayout, updateBoundsMethods declared in class javafx.scene.NodeaccessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, executeAccessibleAction, fireEvent, focusedProperty, focusTraversableProperty, focusVisibleProperty, focusWithinProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, getViewOrder, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isFocusVisible, isFocusWithin, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookup, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, queryAccessibleAttribute, relocate, removeEventFilter, removeEventHandler, requestFocus, requestFocusTraversal, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visiblePropertyMethods declared in class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods declared in interface javafx.css.StyleablegetStyleableNode
- 
Property Details- 
fontThe default font to use for text in the TextInputControl. If the TextInputControl's text is rich text then this font may or may not be used depending on the font information embedded in the rich text, but in any case where a default font is required, this font will be used.- Since:
- JavaFX 8.0
- See Also:
 
- 
promptTextThe prompt text to display in theTextInputControl. If set to null or an empty string, no prompt text is displayed.- Default value:
- An empty String
- Since:
- JavaFX 2.2
- See Also:
 
- 
textFormatterThe property contains currently attachedTextFormatter. Since the value is part of theFormatter, changing the TextFormatter will update the text based on the new textFormatter.- Default value:
- null
- Since:
- JavaFX 8u40
- See Also:
 
- 
text
- 
lengthThe number of characters in the text input.- See Also:
 
- 
editableIndicates whether this TextInputControl can be edited by the user.- See Also:
 
- 
selection
- 
selectedTextDefines the characters in the TextInputControl which are selected- See Also:
 
- 
anchorTheanchorof the text selection. TheanchorandcaretPositionmake up the selection range. Selection must always be specified in terms of begin <= end, butanchormay be less than, equal to, or greater than thecaretPosition. Depending on how the user selects text, the anchor might represent the lower or upper bound of the selection.- See Also:
 
- 
caretPositionThe current position of the caret within the text. TheanchorandcaretPositionmake up the selection range. Selection must always be specified in terms of begin <= end, butanchormay be less than, equal to, or greater than thecaretPosition. Depending on how the user selects text, the caretPosition might represent the lower or upper bound of the selection.- See Also:
 
- 
undoableThe property describes if it's currently possible to undo the latest change of the content that was done.- Default value:
- false
- Since:
- JavaFX 8u40
- See Also:
 
- 
redoableThe property describes if it's currently possible to redo the latest change of the content that was undone.- Default value:
- false
- Since:
- JavaFX 8u40
- See Also:
 
 
- 
- 
Constructor Details- 
TextInputControlCreates a new TextInputControl. The content is an immutable property and must be specified (as non-null) at the time of construction.- Parameters:
- content- a non-null implementation of Content.
 
 
- 
- 
Method Details- 
fontPropertyThe default font to use for text in the TextInputControl. If the TextInputControl's text is rich text then this font may or may not be used depending on the font information embedded in the rich text, but in any case where a default font is required, this font will be used.- Returns:
- the font property
- Since:
- JavaFX 8.0
- See Also:
 
- 
setFontSets the value of thefontproperty.- Property description:
- The default font to use for text in the TextInputControl. If the TextInputControl's text is rich text then this font may or may not be used depending on the font information embedded in the rich text, but in any case where a default font is required, this font will be used.
- Parameters:
- value- the value for the- fontproperty
- Since:
- JavaFX 8.0
- See Also:
 
- 
getFontGets the value of thefontproperty.- Property description:
- The default font to use for text in the TextInputControl. If the TextInputControl's text is rich text then this font may or may not be used depending on the font information embedded in the rich text, but in any case where a default font is required, this font will be used.
- Returns:
- the value of the fontproperty
- Since:
- JavaFX 8.0
- See Also:
 
- 
promptTextPropertyThe prompt text to display in theTextInputControl. If set to null or an empty string, no prompt text is displayed.- Default value:
- An empty String
- Returns:
- the promptTextproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
getPromptTextGets the value of thepromptTextproperty.- Property description:
- The prompt text to display in the TextInputControl. If set to null or an empty string, no prompt text is displayed.
- Default value:
- An empty String
- Returns:
- the value of the promptTextproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
setPromptTextSets the value of thepromptTextproperty.- Property description:
- The prompt text to display in the TextInputControl. If set to null or an empty string, no prompt text is displayed.
- Default value:
- An empty String
- Parameters:
- value- the value for the- promptTextproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
textFormatterPropertyThe property contains currently attachedTextFormatter. Since the value is part of theFormatter, changing the TextFormatter will update the text based on the new textFormatter.- Default value:
- null
- Returns:
- the textFormatterproperty
- Since:
- JavaFX 8u40
- See Also:
 
- 
getTextFormatterGets the value of thetextFormatterproperty.- Property description:
- The property contains currently attached TextFormatter. Since the value is part of theFormatter, changing the TextFormatter will update the text based on the new textFormatter.
- Default value:
- null
- Returns:
- the value of the textFormatterproperty
- Since:
- JavaFX 8u40
- See Also:
 
- 
setTextFormatterSets the value of thetextFormatterproperty.- Property description:
- The property contains currently attached TextFormatter. Since the value is part of theFormatter, changing the TextFormatter will update the text based on the new textFormatter.
- Default value:
- null
- Parameters:
- value- the value for the- textFormatterproperty
- Since:
- JavaFX 8u40
- See Also:
 
- 
getContentReturns the text input's content model.- Returns:
- the text input's content model
 
- 
getTextGets the value of thetextproperty.- Property description:
- The textual content of this TextInputControl.
- Returns:
- the value of the textproperty
- See Also:
 
- 
setTextSets the value of thetextproperty.- Property description:
- The textual content of this TextInputControl.
- Parameters:
- value- the value for the- textproperty
- See Also:
 
- 
textPropertyThe textual content of this TextInputControl.- Returns:
- the textproperty
- See Also:
 
- 
getLengthpublic final int getLength()Gets the value of thelengthproperty.- Property description:
- The number of characters in the text input.
- Returns:
- the value of the lengthproperty
- See Also:
 
- 
lengthPropertyThe number of characters in the text input.- Returns:
- the lengthproperty
- See Also:
 
- 
isEditablepublic final boolean isEditable()Gets the value of theeditableproperty.- Property description:
- Indicates whether this TextInputControl can be edited by the user.
- Returns:
- the value of the editableproperty
- See Also:
 
- 
setEditablepublic final void setEditable(boolean value) Sets the value of theeditableproperty.- Property description:
- Indicates whether this TextInputControl can be edited by the user.
- Parameters:
- value- the value for the- editableproperty
- See Also:
 
- 
editablePropertyIndicates whether this TextInputControl can be edited by the user.- Returns:
- the editableproperty
- See Also:
 
- 
getSelectionGets the value of theselectionproperty.- Property description:
- The current selection.
- Returns:
- the value of the selectionproperty
- See Also:
 
- 
selectionPropertyThe current selection.- Returns:
- the selectionproperty
- See Also:
 
- 
getSelectedTextGets the value of theselectedTextproperty.- Property description:
- Defines the characters in the TextInputControl which are selected
- Returns:
- the value of the selectedTextproperty
- See Also:
 
- 
selectedTextPropertyDefines the characters in the TextInputControl which are selected- Returns:
- the selectedTextproperty
- See Also:
 
- 
getAnchorpublic final int getAnchor()Gets the value of theanchorproperty.- Property description:
- The anchorof the text selection. TheanchorandcaretPositionmake up the selection range. Selection must always be specified in terms of begin <= end, butanchormay be less than, equal to, or greater than thecaretPosition. Depending on how the user selects text, the anchor might represent the lower or upper bound of the selection.
- Returns:
- the value of the anchorproperty
- See Also:
 
- 
anchorPropertyTheanchorof the text selection. TheanchorandcaretPositionmake up the selection range. Selection must always be specified in terms of begin <= end, butanchormay be less than, equal to, or greater than thecaretPosition. Depending on how the user selects text, the anchor might represent the lower or upper bound of the selection.- Returns:
- the anchorproperty
- See Also:
 
- 
getCaretPositionpublic final int getCaretPosition()Gets the value of thecaretPositionproperty.- Property description:
- The current position of the caret within the text.
 The anchorandcaretPositionmake up the selection range. Selection must always be specified in terms of begin <= end, butanchormay be less than, equal to, or greater than thecaretPosition. Depending on how the user selects text, the caretPosition might represent the lower or upper bound of the selection.
- Returns:
- the value of the caretPositionproperty
- See Also:
 
- 
caretPositionPropertyThe current position of the caret within the text. TheanchorandcaretPositionmake up the selection range. Selection must always be specified in terms of begin <= end, butanchormay be less than, equal to, or greater than thecaretPosition. Depending on how the user selects text, the caretPosition might represent the lower or upper bound of the selection.- Returns:
- the caretPositionproperty
- See Also:
 
- 
isUndoablepublic final boolean isUndoable()Gets the value of theundoableproperty.- Property description:
- The property describes if it's currently possible to undo the latest change of the content that was done.
- Default value:
- false
- Returns:
- the value of the undoableproperty
- Since:
- JavaFX 8u40
- See Also:
 
- 
undoablePropertyThe property describes if it's currently possible to undo the latest change of the content that was done.- Default value:
- false
- Returns:
- the undoableproperty
- Since:
- JavaFX 8u40
- See Also:
 
- 
isRedoablepublic final boolean isRedoable()Gets the value of theredoableproperty.- Property description:
- The property describes if it's currently possible to redo the latest change of the content that was undone.
- Default value:
- false
- Returns:
- the value of the redoableproperty
- Since:
- JavaFX 8u40
- See Also:
 
- 
redoablePropertyThe property describes if it's currently possible to redo the latest change of the content that was undone.- Default value:
- false
- Returns:
- the redoableproperty
- Since:
- JavaFX 8u40
- See Also:
 
- 
getTextReturns a subset of the text input's content.- Parameters:
- start- must be a value between 0 and end - 1.
- end- must be less than or equal to the length
- Returns:
- the subset of the text input's content
 
- 
appendTextAppends a sequence of characters to the content.- Parameters:
- text- a non null String
 
- 
insertTextInserts a sequence of characters into the content.- Parameters:
- index- The location to insert the text.
- text- The text to insert.
 
- 
deleteTextRemoves a range of characters from the content.- Parameters:
- range- The range of text to delete. The range object must not be null.
- See Also:
 
- 
deleteTextpublic void deleteText(int start, int end) Removes a range of characters from the content.- Parameters:
- start- The starting index in the range, inclusive. This must be >= 0 and < the end.
- end- The ending index in the range, exclusive. This is one-past the last character to delete (consistent with the String manipulation methods). This must be > the start, and <= the length of the text.
 
- 
replaceTextReplaces a range of characters with the given text.- Parameters:
- range- The range of text to replace. The range object must not be null.
- text- The text that is to replace the range. This must not be null.
- See Also:
 
- 
replaceTextReplaces a range of characters with the given text.- Parameters:
- start- The starting index in the range, inclusive. This must be >= 0 and < the end.
- end- The ending index in the range, exclusive. This is one-past the last character to delete (consistent with the String manipulation methods). This must be > the start, and <= the length of the text.
- text- The text that is to replace the range. This must not be null.
 
- 
cutpublic void cut()Transfers the currently selected range in the text to the clipboard, removing the current selection.
- 
copypublic void copy()Transfers the currently selected range in the text to the clipboard, leaving the current selection.
- 
pastepublic void paste()Transfers the contents in the clipboard into this text, replacing the current selection. If there is no selection, the contents in the clipboard is inserted at the current caret position.
- 
selectBackwardpublic void selectBackward()Moves the selection backward one char in the text. This may have the effect of deselecting, depending on the location of the anchor relative to the caretPosition. This function effectively just moves the caretPosition.
- 
selectForwardpublic void selectForward()Moves the selection forward one char in the text. This may have the effect of deselecting, depending on the location of the anchor relative to the caretPosition. This function effectively just moves the caret forward.
- 
previousWordpublic void previousWord()Moves the caret to the beginning of previous word. This function also has the effect of clearing the selection.
- 
nextWordpublic void nextWord()Moves the caret to the beginning of next word. This function also has the effect of clearing the selection.
- 
endOfNextWordpublic void endOfNextWord()Moves the caret to the end of the next word. This function also has the effect of clearing the selection.
- 
selectPreviousWordpublic void selectPreviousWord()Moves the caret to the beginning of previous word. This does not cause the selection to be cleared. Rather, the anchor stays put and the caretPosition is moved to the beginning of previous word.
- 
selectNextWordpublic void selectNextWord()Moves the caret to the beginning of next word. This does not cause the selection to be cleared. Rather, the anchor stays put and the caretPosition is moved to the beginning of next word.
- 
selectEndOfNextWordpublic void selectEndOfNextWord()Moves the caret to the end of the next word. This does not cause the selection to be cleared.
- 
selectAllpublic void selectAll()Selects all text in the text input.
- 
homepublic void home()Moves the caret to before the first char of the text. This function also has the effect of clearing the selection.
- 
endpublic void end()Moves the caret to after the last char of the text. This function also has the effect of clearing the selection.
- 
selectHomepublic void selectHome()Moves the caret to before the first char of text. This does not cause the selection to be cleared. Rather, the anchor stays put and the caretPosition is moved to before the first char.
- 
selectEndpublic void selectEnd()Moves the caret to after the last char of text. This does not cause the selection to be cleared. Rather, the anchor stays put and the caretPosition is moved to after the last char.
- 
deletePreviousCharpublic boolean deletePreviousChar()Deletes the character that precedes the current caret position from the text if there is no selection, or deletes the selection if there is one. This function returns true if the deletion succeeded, false otherwise.- Returns:
- true if the deletion succeeded, false otherwise
 
- 
deleteNextCharpublic boolean deleteNextChar()Deletes the character that follows the current caret position from the text if there is no selection, or deletes the selection if there is one. This function returns true if the deletion succeeded, false otherwise.- Returns:
- true if the deletion succeeded, false otherwise
 
- 
forwardpublic void forward()Moves the caret position forward. If there is no selection, then the caret position is moved one character forward. If there is a selection, then the caret position is moved to the end of the selection and the selection cleared.
- 
backwardpublic void backward()Moves the caret position backward. If there is no selection, then the caret position is moved one character backward. If there is a selection, then the caret position is moved to the beginning of the selection and the selection cleared. Note: This function is intended to be used by experts, primarily by those implementing new Skins or Behaviors. It is not common for developers or designers to access this function directly.
- 
positionCaretpublic void positionCaret(int pos) Positions the caret to the position indicated bypos. This function will also clear the selection.- Parameters:
- pos- the position
 
- 
selectPositionCaretpublic void selectPositionCaret(int pos) Positions the caret to the position indicated byposand extends the selection, if there is one. If there is no selection, then a selection is formed where the anchor is at the current caret position and the caretPosition is moved to pos.- Parameters:
- pos- the position
 
- 
selectRangepublic void selectRange(int anchor, int caretPosition) Positions the anchor and caretPosition explicitly.- Parameters:
- anchor- the anchor
- caretPosition- the caretPosition
 
- 
extendSelectionpublic void extendSelection(int pos) This function will extend the selection to include the specified pos. This is different from selectPositionCaret in that it does not simply move the caret. Rather, it will reposition the caret and anchor as necessary to ensure that pos becomes the new caret and the far other end of the selection becomes the anchor.- Parameters:
- pos- the position
 
- 
clearpublic void clear()Clears the text.
- 
deselectpublic void deselect()Clears the selection.
- 
replaceSelectionReplaces the selection with the given replacement String. If there is no selection, then the replacement text is simply inserted at the current caret position. If there was a selection, then the selection is cleared and the given replacement text inserted.- Parameters:
- replacement- the replacement string
 
- 
undopublic final void undo()If possible, undoes the last modification. IfisUndoable()returns false, then calling this method has no effect.- Since:
- JavaFX 8u40
 
- 
redopublic final void redo()If possible, redoes the last undone modification. IfisRedoable()returns false, then calling this method has no effect.- Since:
- JavaFX 8u40
 
- 
commitValuepublic final void commitValue()Commit the current text and convert it to a value.- Since:
- JavaFX 8u40
 
- 
cancelEditpublic final void cancelEdit()If the field is currently being edited, this call will set text to the last committed value.- Since:
- JavaFX 8u40
 
- 
getClassCssMetaDataGets theCssMetaDataassociated with this class, which may include theCssMetaDataof its superclasses.- Returns:
- the CssMetaData
- Since:
- JavaFX 8.0
 
- 
getControlCssMetaDataGets the unmodifiable list of the control's CSS-styleable properties.- Overrides:
- getControlCssMetaDatain class- Control
- Returns:
- the unmodifiable list of the control's CSS-styleable properties
- Since:
- JavaFX 8.0
 
 
-