Класс TextInputControl
- javafx.scene.Node
-
- javafx.scene.Parent
-
- javafx.scene.layout.Region
-
- javafx.scene.control.Control
-
- javafx.scene.control.TextInputControl
Все реализованные интерфейсы:
@DefaultProperty(value="text") public abstract class TextInputControl extends Control
С тех пор:
JavaFX 2.0
-
Краткое описание свойств
Все методыМетоды экземпляровКонкретные методы Тип Свойство и описание ReadOnlyIntegerPropertyanchorВыделение текста.ReadOnlyIntegerPropertycaretPositionТекущая позиция курсора в тексте.BooleanPropertyeditableУказывает, можно ли редактировать TextInputControl пользователем.ObjectProperty<Font>fontШрифт по умолчанию для текста в TextInputControl.ReadOnlyIntegerPropertylengthКоличество символов в поле ввода.StringPropertypromptTextТекст подсказки для отображения в поле ввода, или null, если подсказка не отображается.ReadOnlyBooleanPropertyredoableСвойство описывает, можно ли выполнить повторное выполнение последнего действия, которое было отменено.ReadOnlyStringPropertyselectedTextОпределяет символы в TextInputControl, которые выделены.ReadOnlyObjectProperty<IndexRange>selectionТекущее выделение.ObjectProperty<TextFormatter<?>>textFormatterСвойство содержит текущие присоединённыеTextFormatter.StringPropertytextТекстовое содержимое TextInputControl.ReadOnlyBooleanPropertyundoableСвойство описывает, можно ли отменить последнее выполненное действие.-
Свойства унаследованные от класса javafx.scene.control.Control
contextMenu, skin, tooltip
-
Свойства унаследованные от класса javafx.scene.layout.Region
background, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, width
-
Свойства унаследованные от класса javafx.scene.Parent
needsLayout
-
Свойства унаследованные от класса javafx.scene.Node
accessibleHelp, accessibleRoleDescription, accessibleRole, accessibleText, blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, 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, visible
-
-
Краткое описание вложенных классов
Вложенные классы Модификатор и тип Класс и описание protected static interfaceTextInputControl.ContentИнтерфейс, представляющий содержимое элемента ввода текста.
-
Краткое описание полей
-
Поля унаследованные от класса javafx.scene.layout.Region
USE_COMPUTED_SIZE, USE_PREF_SIZE
-
Поля унаследованные от класса javafx.scene.Node
BASELINE_OFFSET_SAME_AS_HEIGHT
-
-
Краткое описание конструкторов
Конструкторы Модификатор Конструктор и описание protectedTextInputControl(TextInputControl.Content content)Создаёт новый TextInputControl.
-
Краткое описание методов
Все методыСтатические методыМетоды экземпляровКонкретные методы Модификатор и тип Метод и описание ReadOnlyIntegerPropertyanchorProperty()Выделение текста.voidappendText(String text)Добавляет последовательность символов к содержимому.voidbackward()Перемещает позицию курсора назад.voidcancelEdit()Если поле в данный момент редактируется, этот вызов установит текст на последнее сохранённое значение.ReadOnlyIntegerPropertycaretPositionProperty()Текущая позиция курсора в тексте.voidclear()Очищает текст.voidcommitValue()Сохраняет текущий текст и преобразует его в значение.voidcopy()Переносит текущую выделенную область текста в буфер обмена, сохраняя текущий выделенный текст.voidcut()Переносит текущую выделенную область текста в буфер обмена, удаляя текущий выделенный текст.booleandeleteNextChar()Удаляет символ, следующий за текущей позицией курсора из текста, если нет выделения, или удаляет выделение, если оно есть.booleandeletePreviousChar()Удаляет символ, предшествующий текущей позиции курсора из текста, если нет выделения, или удаляет выделение, если оно есть.voiddeleteText(IndexRange range)Удаляет диапазон символов из содержимого.voiddeleteText(int start, int end)Удаляет диапазон символов из содержимого.voiddeselect()Очищает выделение.BooleanPropertyeditableProperty()Указывает, можно ли редактировать это TextInputControl пользователем.voidend()Перемещает курсор после последнего символа текста.voidendOfNextWord()Перемещает курсор в конец следующего слова.voidexecuteAccessibleAction(AccessibleAction action, Object... parameters)Этот метод вызывается вспомогательной технологией для запроса выполнения действия, указанного в аргументе.voidextendSelection(int pos)Эта функция расширит выделение, включив указанную позицию.ObjectProperty<Font>fontProperty()Шрифт по умолчанию для использования в тексте в TextInputControl.voidforward()Перемещает позицию курсора вперёд.intgetAnchor()Получает значение свойства anchor.intgetCaretPosition()Получает значение свойства caretPosition.static List<CssMetaData<? extends Styleable,?>>getClassCssMetaData()protected TextInputControl.ContentgetContent()Возвращает модель содержимого текстового ввода.List<CssMetaData<? extends Styleable,?>>getControlCssMetaData()FontgetFont()Получает значение свойства font.intgetLength()Получает значение свойства length.StringgetPromptText()Получает значение свойства promptText.StringgetSelectedText()Получает значение свойства selectedText.IndexRangegetSelection()Получает значение свойства selection.StringgetText()Получает значение свойства text.StringgetText(int start, int end)Возвращает подмножество содержимого текстового ввода.TextFormatter<?>getTextFormatter()Получает значение свойства textFormatter.voidhome()Перемещает курсор перед первым символом текста.voidinsertText(int index, String text)Вставляет последовательность символов в содержимое.booleanisEditable()Получает значение свойства editable.booleanisRedoable()Получает значение свойства redoable.booleanisUndoable()Получает значение свойства undoable.ReadOnlyIntegerPropertylengthProperty()Количество символов в текстовом вводе.voidnextWord()Перемещает курсор в начало следующего слова.voidpaste()Переносит содержимое буфера обмена в этот текст, заменяя текущее выделение.voidpositionCaret(int pos)Позиционирует курсор в позицию, указаннуюpos.voidpreviousWord()Перемещает курсор в начало предыдущего слова.StringPropertypromptTextProperty()Текст подсказки, отображаемый вTextInputControl, или null, если текст подсказки не отображается.ObjectqueryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters)* Обработка доступности * *voidredo()Если возможно, повторяет последнее отменённое изменение.ReadOnlyBooleanPropertyredoableProperty()Свойство описывает, возможно ли в данный момент повторить последнее отменённое изменение содержимого.voidreplaceSelection(String replacement)Заменяет выделение заданной строкой замены.voidreplaceText(IndexRange range, String text)Заменяет диапазон символов заданным текстом.voidreplaceText(int start, int end, String text)Заменяет диапазон символов заданным текстом.voidselectAll()Выделяет весь текст в текстовом вводе.voidselectBackward()Перемещает выделение назад на один символ в тексте.ReadOnlyStringPropertyselectedTextProperty()Определяет символы в TextInputControl, которые выделеныvoidselectEnd()Перемещает курсор после последнего символа текста.voidselectEndOfNextWord()Перемещает курсор в конец следующего слова.voidselectForward()Перемещает выделение вперёд на один символ в тексте.voidselectHome()Перемещает курсор перед первым символом текста.ReadOnlyObjectProperty<IndexRange>selectionProperty()Текущее выделение.voidselectNextWord()Перемещает курсор в начало следующего слова.voidselectPositionCaret(int pos)Позиционирует курсор в позицию, указаннуюpos, и расширяет выделение, если оно есть.voidselectPreviousWord()Перемещает курсор в начало предыдущего слова.voidselectRange(int anchor, int caretPosition)Явно задаёт значения anchor и caretPosition.voidsetEditable(boolean value)Устанавливает значение свойства editable.voidsetFont(Font value)Устанавливает значение свойства font.voidsetPromptText(String value)Устанавливает значение свойства promptText.voidsetText(String value)Устанавливает значение свойства text.voidsetTextFormatter(TextFormatter<?> value)Устанавливает значение свойства textFormatter.ObjectProperty<TextFormatter<?>>textFormatterProperty()Свойство содержит присоединённые в данный моментTextFormatter.StringPropertytextProperty()Текстовое содержимое данного TextInputControl.voidundo()Если возможно, отменяет последнее изменение.ReadOnlyBooleanPropertyundoableProperty()Свойство описывает, возможно ли в данный момент отменить последнее внесённое изменение содержимого.
-
Методы, унаследованные от класса javafx.scene.control.Control
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, createDefaultSkin, getBaselineOffset, getContextMenu, getCssMetaData, getSkin, getTooltip, isResizable, layoutChildren, setContextMenu, setSkin, setTooltip, skinProperty, tooltipProperty
-
Методы, унаследованные от класса javafx.scene.layout.Region
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, 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, snapSize, snapSpace, snapToPixelProperty, widthProperty
-
Методы, унаследованные от класса javafx.scene.Parent
getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, requestLayout, requestParentLayout, setNeedsLayout, updateBounds
-
Методы, унаследованные от класса javafx.scene.Node
accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, 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, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, 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, 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, relocate, removeEventFilter, removeEventHandler, requestFocus, 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, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, visibleProperty
-
-
Подробное описание свойств
-
font
public final ObjectProperty<Font> fontProperty
Шрифт по умолчанию для использования текста в TextInputControl. Если текст TextInputControl является форматированным текстом, то этот шрифт может быть или не быть использован в зависимости от информации о шрифте, встроенной в форматированный текст. В любом случае, когда требуется шрифт по умолчанию, будет использован этот шрифт.С момента:
JavaFX 8.0
См. также:
-
promptText
public final StringProperty promptTextProperty
Текст подсказки, отображаемый в поле ввода, или null, если текст подсказки не отображается.С момента:
JavaFX 2.2
См. также:
-
textFormatter
public final ObjectProperty<TextFormatter<?>> textFormatterProperty
Свойство содержит текущие присоединённыеTextFormatter. Поскольку значение является частьюFormatter, изменение TextFormatter обновит текст на основе нового TextFormatter.Значение по умолчанию:
null
С момента:
JavaFX 8u40
См. также:
-
text
public final StringProperty textProperty
Текстовое содержимое TextInputControl.См. также:
-
length
public final ReadOnlyIntegerProperty lengthProperty
Количество символов в поле ввода.См. также:
-
editable
public final BooleanProperty editableProperty
Указывает, можно ли редактировать TextInputControl пользователем.См. также:
-
selection
public final ReadOnlyObjectProperty<IndexRange> selectionProperty
Текущая выделенная область.См. также:
-
selectedText
public final ReadOnlyStringProperty selectedTextProperty
Определяет символы в TextInputControl, которые выделены.См. также:
-
anchor
public final ReadOnlyIntegerProperty anchorProperty
anchorначала выделения текста.anchorиcaretPositionзадают диапазон выделения. Выделение всегда должно задаваться в виде begin <= end, ноanchorможет быть меньше, равно или большеcaretPosition. В зависимости от способа выбора текста пользователем, anchor может представлять собой нижнюю или верхнюю границу выделения.См. также:
-
caretPosition
public final ReadOnlyIntegerProperty caretPositionProperty
Текущая позиция курсора в тексте.anchorиcaretPositionзадают диапазон выделения. Выделение всегда должно задаваться в виде begin <= end, ноanchorможет быть меньше, равно или большеcaretPosition. В зависимости от способа выбора текста пользователем, caretPosition может представлять собой нижнюю или верхнюю границу выделения.См. также:
-
undoable
public final ReadOnlyBooleanProperty undoableProperty
Свойство описывает, возможно ли сейчас отменить последнее изменение содержимого.
-
redoable
public final ReadOnlyBooleanProperty redoableProperty
Свойство описывает, возможно ли сейчас повторить последнее отменённое изменение содержимого.
-
-
Подробное описание конструкторов
-
TextInputControl
protected TextInputControl(TextInputControl.Content content)
Создаёт новый TextInputControl. Содержимое — неизменяемое свойство и должно быть указано (в качестве значения, отличного от null) во время создания.Параметры:
content— непустая реализация интерфейса Content.
-
-
Method Detail
-
fontProperty
public final ObjectProperty<Font> fontProperty()
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.Since:
JavaFX 8.0
See Also:
-
setFont
public final void setFont(Font value)
Sets the value of the property font.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.
Since:
JavaFX 8.0
-
getFont
public final Font getFont()
Gets the value of the property font.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.
Since:
JavaFX 8.0
-
promptTextProperty
public final StringProperty promptTextProperty()
The prompt text to display in theTextInputControl, or null if no prompt text is displayed.Since:
JavaFX 2.2
See Also:
-
getPromptText
public final String getPromptText()
Gets the value of the property promptText.Property description:
The prompt text to display in the
TextInputControl, or null if no prompt text is displayed.Since:
JavaFX 2.2
-
setPromptText
public final void setPromptText(String value)
Sets the value of the property promptText.Property description:
The prompt text to display in the
TextInputControl, or null if no prompt text is displayed.Since:
JavaFX 2.2
-
textFormatterProperty
public final ObjectProperty<TextFormatter<?>> textFormatterProperty()
The 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
-
getTextFormatter
public final TextFormatter<?> getTextFormatter()
Gets the value of the property textFormatter.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
Since:
JavaFX 8u40
-
setTextFormatter
public final void setTextFormatter(TextFormatter<?> value)
Sets the value of the property textFormatter.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
Since:
JavaFX 8u40
-
getContent
protected final TextInputControl.Content getContent()
Returns the text input's content model.
-
getText
public final String getText()
Gets the value of the property text.Property description:
The textual content of this TextInputControl.
-
setText
public final void setText(String value)
Sets the value of the property text.Property description:
The textual content of this TextInputControl.
-
textProperty
public final StringProperty textProperty()
The textual content of this TextInputControl.See Also:
-
getLength
public final int getLength()
Gets the value of the property length.Property description:
The number of characters in the text input.
-
lengthProperty
public final ReadOnlyIntegerProperty lengthProperty()
The number of characters in the text input.See Also:
-
isEditable
public final boolean isEditable()
Gets the value of the property editable.Property description:
Indicates whether this TextInputControl can be edited by the user.
-
setEditable
public final void setEditable(boolean value)
Sets the value of the property editable.Property description:
Indicates whether this TextInputControl can be edited by the user.
-
editableProperty
public final BooleanProperty editableProperty()
Indicates whether this TextInputControl can be edited by the user.See Also:
-
getSelection
public final IndexRange getSelection()
Gets the value of the property selection.Property description:
The current selection.
-
selectionProperty
public final ReadOnlyObjectProperty<IndexRange> selectionProperty()
The current selection.See Also:
-
getSelectedText
public final String getSelectedText()
Gets the value of the property selectedText.Property description:
Defines the characters in the TextInputControl which are selected
-
selectedTextProperty
public final ReadOnlyStringProperty selectedTextProperty()
Defines the characters in the TextInputControl which are selectedSee Also:
-
getAnchor
public final int getAnchor()
Gets the value of the property anchor.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.
-
anchorProperty
public final ReadOnlyIntegerProperty anchorProperty()
Theanchorof 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:
-
getCaretPosition
public final int getCaretPosition()
Gets the value of the property caretPosition.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.
-
caretPositionProperty
public final ReadOnlyIntegerProperty caretPositionProperty()
The 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:
-
isUndoable
public final boolean isUndoable()
Gets the value of the property undoable.Property description:
The property describes if it's currently possible to undo the latest change of the content that was done.
Default value:
false
Since:
JavaFX 8u40
-
undoableProperty
public final ReadOnlyBooleanProperty undoableProperty()
The property describes if it's currently possible to undo the latest change of the content that was done.
-
-
isRedoable
public final boolean isRedoable()
Получает значение свойства redoable.Описание свойства:
Свойство описывает, можно ли сейчас выполнить повторное действие последнего отменённого изменения содержимого.
Значение по умолчанию:
false
С момента:
JavaFX 8u40
-
redoableProperty
public final ReadOnlyBooleanProperty redoableProperty()
Свойство описывает, можно ли сейчас выполнить повторное действие последнего отменённого изменения содержимого.
-
getText
public String getText(int start, int end)Возвращает подмножество содержимого текстового поля.Параметры:
start- должно быть значением между 0 и end - 1.
-
appendText
public void appendText(String text)
Добавляет последовательность символов к содержимому.Параметры:
text- непустая строка
-
insertText
public void insertText(int index, String text)Вставляет последовательность символов в содержимое.Параметры:
index- Место вставки текста.
-
deleteText
public void deleteText(IndexRange range)
Удаляет диапазон символов из содержимого.Параметры:
range- Диапазон текста для удаления. Объект диапазона не должен быть null.См. также:
-
deleteText
public void deleteText(int start, int end)Удаляет диапазон символов из содержимого.Параметры:
start- Начальный индекс диапазона, включительно. Должно быть >= 0 и < конечного значения.
-
replaceText
public void replaceText(IndexRange range, String text)Заменяет диапазон символов заданным текстом.Параметры:
range- Диапазон текста для замены. Объект диапазона не должен быть null.См. также:
-
replaceText
public void replaceText(int start, int end, String text)Заменяет диапазон символов заданным текстом.Параметры:
start- Начальный индекс диапазона, включительно. Должно быть >= 0 и < конечного значения.
-
cut
public void cut()
Переносит текущий выделенный диапазон текста в буфер обмена, удаляя выделение.
-
copy
public void copy()
Переносит текущий выделенный диапазон текста в буфер обмена, сохраняя выделение.
-
paste
public void paste()
Переносит содержимое из буфера обмена в текст, заменяя текущее выделение. Если выделения нет, содержимое из буфера обмена вставляется в текущую позицию курсора.
-
selectBackward
public void selectBackward()
Перемещает выделение назад на один символ в тексте. Это может привести к отмене выделения, в зависимости от расположения якоря относительно позиции курсора. Данная функция фактически просто перемещает позицию курсора.
-
selectForward
public void selectForward()
Перемещает выделение вперёд на один символ в тексте. Это может привести к отмене выделения, в зависимости от расположения якоря относительно позиции курсора. Данная функция фактически просто перемещает курсор вперёд.
-
previousWord
public void previousWord()
Перемещает курсор к началу предыдущего слова. Эта функция также приводит к очистке выделения.
-
nextWord
public void nextWord()
Перемещает курсор к началу следующего слова. Эта функция также приводит к очистке выделения.
-
endOfNextWord
public void endOfNextWord()
Перемещает курсор к концу следующего слова. Эта функция также приводит к очистке выделения.
-
selectPreviousWord
public void selectPreviousWord()
Перемещает курсор к началу предыдущего слова. Это не приводит к очистке выделения. Вместо этого, якорь остаётся на месте, а позиция курсора перемещается к началу предыдущего слова.
-
selectNextWord
public void selectNextWord()
Перемещает курсор к началу следующего слова. Это не приводит к очистке выделения. Вместо этого, якорь остаётся на месте, а позиция курсора перемещается к началу следующего слова.
-
selectEndOfNextWord
public void selectEndOfNextWord()
Перемещает курсор к концу следующего слова. Это не приводит к очистке выделения.
-
selectAll
public void selectAll()
Выделяет весь текст в текстовом поле.
-
home
public void home()
Перемещает курсор перед первым символом текста. Эта функция также приводит к очистке выделения.
-
end
public void end()
Перемещает курсор после последнего символа текста. Эта функция также приводит к очистке выделения.
-
selectHome
public void selectHome()
Перемещает курсор перед первым символом текста. Это не приводит к очистке выделения. Вместо этого, якорь остаётся на месте, а позиция курсора перемещается перед первым символом.
-
selectEnd
public void selectEnd()
Перемещает курсор после последнего символа текста. Это не приводит к очистке выделения. Вместо этого, якорь остаётся на месте, а позиция курсора перемещается после последнего символа.
-
deletePreviousChar
public boolean deletePreviousChar()
Удаляет символ, предшествующий текущей позиции курсора, из текста, если выделения нет, или удаляет выделение, если оно есть. Эта функция возвращает true, если удаление прошло успешно, и false в противном случае.
-
deleteNextChar
public boolean deleteNextChar()
Удаляет символ, следующий за текущей позицией курсора, из текста, если выделения нет, или удаляет выделение, если оно есть. Эта функция возвращает true, если удаление прошло успешно, и false в противном случае.
-
forward
public void forward()
Перемещает позицию курсора вперёд. Если выделения нет, то позиция курсора перемещается на один символ вперёд. Если выделение есть, то позиция курсора перемещается в конец выделения, и выделение очищается.
-
backward
public void backward()
Перемещает позицию курсора назад. Если выделения нет, то позиция курсора перемещается на один символ назад. Если выделение есть, то позиция курсора перемещается в начало выделения, и выделение очищается.
-
positionCaret
public void positionCaret(int pos)
Устанавливает курсор в позицию, указанную значениемpos. Эта функция также очистит выделение.
-
selectPositionCaret
public void selectPositionCaret(int pos)
Устанавливает курсор в позицию, указанную значениемpos, и расширяет выделение, если оно есть. Если выделения нет, то формируется выделение, где якорь находится в текущей позиции курсора, а позиция курсора перемещается в pos.
-
selectRange
public void selectRange(int anchor, int caretPosition)Явно устанавливает якорь и позицию курсора.
-
extendSelection
public void extendSelection(int pos)
Эта функция расширит выделение, включив в него указанное значение pos. Это отличается от selectPositionCaret тем, что она не просто перемещает курсор. Вместо этого она переместит курсор и якорь, чтобы гарантировать, что pos станет новым курсором, а другой край выделения станет якорем.
-
clear
public void clear()
Очищает текст.
-
deselect
public void deselect()
Очищает выделение.
-
replaceSelection
public void replaceSelection(String replacement)
Заменяет выделение заданной строкой замены. Если выделения нет, то текст замены просто вставляется в текущую позицию курсора. Если выделение было, то выделение очищается, и вставляется заданный текст замены.
-
undo
public final void undo()
Если возможно, отменяет последнее изменение. ЕслиisUndoable()возвращает false, то вызов этого метода не окажет никакого влияния.С момента:
JavaFX 8u40
-
redo
public final void redo()
Если возможно, повторяет последнее отменённое изменение. ЕслиisRedoable()возвращает false, то вызов этого метода не окажет никакого влияния.С момента:
JavaFX 8u40
-
commitValue
public final void commitValue()
Сохраняет текущий текст и преобразует его в значение.С момента:
JavaFX 8u40
-
cancelEdit
public final void cancelEdit()
Если поле в данный момент редактируется, этот вызов установит текст до последнего сохранённого значения.С момента:
JavaFX 8u40
-
getClassCssMetaData
public static List<CssMetaData<? extends Styleable,?>> getClassCssMetaData()
Возвращает:
CssMetaData, связанную с этим классом, которая может включать CssMetaData его суперклассов.
С момента:
JavaFX 8.0
-
getControlCssMetaData
public List<CssMetaData<? extends Styleable,?>> getControlCssMetaData()
Переопределяет:
getControlCssMetaDataв классеControlВозвращает:
неизменяемый список стилизуемых свойств управления.
С момента:
JavaFX 8.0
-
queryAccessibleAttribute
public Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters)* Обработка доступности * *Переопределяет:
queryAccessibleAttributeв классеControlПараметры:
attribute- запрашиваемый атрибутВозвращает:
значение для запрашиваемого атрибута
См. также:
-
-
executeAccessibleAction
public void executeAccessibleAction(AccessibleAction action, Object... parameters)Описание скопировано из класса:NodeЭтот метод вызывается средствами辅助技术 для запроса выполнения действия, указанного в аргументе.Этот метод обычно переопределяется подклассами для реализации действий, необходимых для определённой роли.
Если конкретное действие не обрабатывается, необходимо вызвать реализацию базового класса.Переопределяет:
executeAccessibleActionв классеControlПараметры:
action- действие для выполненияСм. также:
-
© 2008, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from JavaFX API Documentation.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Java, JavaFX and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.