Spec-Zone .ru
спецификации, руководства, описания, API
|
@DefaultProperty(value="text") public abstract class TextInputControl extends Control
Type | Property and Description |
---|---|
ReadOnlyIntegerProperty |
anchor
The
anchor of the text selection. |
ReadOnlyIntegerProperty |
caretPosition
The current position of the caret within the text.
|
BooleanProperty |
editable
Indicates whether this TextInputControl can be edited by the user.
|
ReadOnlyIntegerProperty |
length
The number of characters in the text input.
|
StringProperty |
promptText
The prompt text to display in the
TextInputControl , or
null if no prompt text is displayed. |
ReadOnlyStringProperty |
selectedText
Defines the characters in the TextInputControl which are selected
|
ReadOnlyObjectProperty<IndexRange> |
selection
The current selection.
|
StringProperty |
text
The textual content of this TextInputControl.
|
contextMenu, height, maxHeight, maxWidth, minHeight, minWidth, prefHeight, prefWidth, skinClassName, skin, tooltip, width
needsLayout
blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effect, eventDispatcher, focused, focusTraversable, hover, id, inputMethodRequests, layoutBounds, layoutX, layoutY, localToParentTransform, localToSceneTransform, managed, mouseTransparent, 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
Modifier and Type | Class and Description |
---|---|
protected static interface |
TextInputControl.Content
Interface representing a text input's content.
|
USE_COMPUTED_SIZE, USE_PREF_SIZE
Modifier | Constructor and Description |
---|---|
protected |
TextInputControl(TextInputControl.Content content)
Creates a new TextInputControl.
|
Modifier and Type | Method and Description |
---|---|
ReadOnlyIntegerProperty |
anchorProperty()
The
anchor of the text selection. |
void |
appendText(java.lang.String text)
Appends a sequence of characters to the content.
|
void |
backward()
Moves the caret position backward.
|
ReadOnlyIntegerProperty |
caretPositionProperty()
The current position of the caret within the text.
|
void |
clear()
Clears the text.
|
void |
copy()
Transfers the currently selected range in the text to the clipboard,
leaving the current selection.
|
void |
cut()
Transfers the currently selected range in the text to the clipboard,
removing the current selection.
|
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.
|
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.
|
void |
deleteText(IndexRange range)
Removes a range of characters from the content.
|
void |
deleteText(int start,
int end)
Removes a range of characters from the content.
|
void |
deselect()
Clears the selection.
|
BooleanProperty |
editableProperty()
Indicates whether this TextInputControl can be edited by the user.
|
void |
end()
Moves the caret to after the last char of the text.
|
void |
endOfNextWord()
Moves the caret to the end of the next word.
|
void |
extendSelection(int pos)
This function will extend the selection to include the specified pos.
|
void |
forward()
Moves the caret position forward.
|
int |
getAnchor()
Gets the value of the property anchor.
|
int |
getCaretPosition()
Gets the value of the property caretPosition.
|
protected TextInputControl.Content |
getContent()
Returns the text input's content model.
|
int |
getLength()
Gets the value of the property length.
|
java.lang.String |
getPromptText()
Gets the value of the property promptText.
|
java.lang.String |
getSelectedText()
Gets the value of the property selectedText.
|
IndexRange |
getSelection()
Gets the value of the property selection.
|
java.lang.String |
getText()
Gets the value of the property text.
|
java.lang.String |
getText(int start,
int end)
Returns a subset of the text input's content.
|
void |
home()
Moves the caret to before the first char of the text.
|
void |
insertText(int index,
java.lang.String text)
Inserts a sequence of characters into the content.
|
boolean |
isEditable()
Gets the value of the property editable.
|
ReadOnlyIntegerProperty |
lengthProperty()
The number of characters in the text input.
|
void |
nextWord()
Moves the caret to the beginning of next word.
|
void |
paste()
Transfers the contents in the clipboard into this text,
replacing the current selection.
|
void |
positionCaret(int pos)
Positions the caret to the position indicated by
pos . |
void |
previousWord()
Moves the caret to the beginning of previous word.
|
StringProperty |
promptTextProperty()
The prompt text to display in the
TextInputControl , or
null if no prompt text is displayed. |
void |
replaceSelection(java.lang.String replacement)
Replaces the selection with the given replacement String.
|
void |
replaceText(IndexRange range,
java.lang.String text)
Replaces a range of characters with the given text.
|
void |
replaceText(int start,
int end,
java.lang.String text)
Replaces a range of characters with the given text.
|
void |
selectAll()
Selects all text in the text input.
|
void |
selectBackward()
Moves the selection backward one char in the text.
|
ReadOnlyStringProperty |
selectedTextProperty()
Defines the characters in the TextInputControl which are selected
|
void |
selectEnd()
Moves the caret to after the last char of text.
|
void |
selectEndOfNextWord()
Moves the caret to the end of the next word.
|
void |
selectForward()
Moves the selection forward one char in the text.
|
void |
selectHome()
Moves the caret to before the first char of text.
|
ReadOnlyObjectProperty<IndexRange> |
selectionProperty()
The current selection.
|
void |
selectNextWord()
Moves the caret to the beginning of next word.
|
void |
selectPositionCaret(int pos)
Positions the caret to the position indicated by
pos and extends
the selection, if there is one. |
void |
selectPreviousWord()
Moves the caret to the beginning of previous word.
|
void |
selectRange(int anchor,
int caretPosition)
Positions the anchor and caretPosition explicitly.
|
void |
setEditable(boolean value)
Sets the value of the property editable.
|
void |
setPromptText(java.lang.String value)
Sets the value of the property promptText.
|
void |
setText(java.lang.String value)
Sets the value of the property text.
|
StringProperty |
textProperty()
The textual content of this TextInputControl.
|
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, getBaselineOffset, getContextMenu, getHeight, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getPrefHeight, getPrefWidth, getSkin, getTooltip, getUserAgentStylesheet, getWidth, heightProperty, intersects, isResizable, layoutChildren, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, setContextMenu, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setPrefHeight, setPrefSize, setPrefWidth, setSkin, setSkinClassName, setTooltip, setWidth, skinClassNameProperty, skinProperty, tooltipProperty, widthProperty
getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, requestLayout, setNeedsLayout
addEventFilter, addEventHandler, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectProperty, eventDispatcherProperty, fireEvent, focusedProperty, focusTraversableProperty, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEventDispatcher, getId, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, 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, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getUserData, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToSceneTransformProperty, lookupAll, managedProperty, mouseTransparentProperty, 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, pickOnBoundsProperty, pressedProperty, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, 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, visibleProperty
public final StringProperty promptTextProperty
TextInputControl
, or
null if no prompt text is displayed.getPromptText()
,
setPromptText(String)
public final StringProperty textProperty
getText()
,
setText(String)
public final ReadOnlyIntegerProperty lengthProperty
getLength()
public final BooleanProperty editableProperty
isEditable()
,
setEditable(boolean)
public final ReadOnlyObjectProperty<IndexRange> selectionProperty
getSelection()
public final ReadOnlyStringProperty selectedTextProperty
getSelectedText()
public final ReadOnlyIntegerProperty anchorProperty
anchor
of the text selection.
The anchor
and caretPosition
make up the selection
range. Selection must always be specified in terms of begin <= end, but
anchor
may be less than, equal to, or greater than the
caretPosition
. Depending on how the user selects text,
the anchor might represent the lower or upper bound of the selection.getAnchor()
public final ReadOnlyIntegerProperty caretPositionProperty
anchor
and caretPosition
make up the selection
range. Selection must always be specified in terms of begin <= end, but
anchor
may be less than, equal to, or greater than the
caretPosition
. Depending on how the user selects text,
the caretPosition might represent the lower or upper bound of the selection.getCaretPosition()
protected TextInputControl(TextInputControl.Content content)
content
- a non-null implementation of Content.public final StringProperty promptTextProperty()
TextInputControl
, or
null if no prompt text is displayed.getPromptText()
,
setPromptText(String)
public final java.lang.String getPromptText()
TextInputControl
, or
null if no prompt text is displayed.public final void setPromptText(java.lang.String value)
TextInputControl
, or
null if no prompt text is displayed.protected final TextInputControl.Content getContent()
public final java.lang.String getText()
public final void setText(java.lang.String value)
public final StringProperty textProperty()
getText()
,
setText(String)
public final int getLength()
public final ReadOnlyIntegerProperty lengthProperty()
getLength()
public final boolean isEditable()
public final void setEditable(boolean value)
public final BooleanProperty editableProperty()
isEditable()
,
setEditable(boolean)
public final IndexRange getSelection()
public final ReadOnlyObjectProperty<IndexRange> selectionProperty()
getSelection()
public final java.lang.String getSelectedText()
public final ReadOnlyStringProperty selectedTextProperty()
getSelectedText()
public final int getAnchor()
anchor
of the text selection.
The anchor
and caretPosition
make up the selection
range. Selection must always be specified in terms of begin <= end, but
anchor
may be less than, equal to, or greater than the
caretPosition
. Depending on how the user selects text,
the anchor might represent the lower or upper bound of the selection.public final ReadOnlyIntegerProperty anchorProperty()
anchor
of the text selection.
The anchor
and caretPosition
make up the selection
range. Selection must always be specified in terms of begin <= end, but
anchor
may be less than, equal to, or greater than the
caretPosition
. Depending on how the user selects text,
the anchor might represent the lower or upper bound of the selection.getAnchor()
public final int getCaretPosition()
anchor
and caretPosition
make up the selection
range. Selection must always be specified in terms of begin <= end, but
anchor
may be less than, equal to, or greater than the
caretPosition
. Depending on how the user selects text,
the caretPosition might represent the lower or upper bound of the selection.public final ReadOnlyIntegerProperty caretPositionProperty()
anchor
and caretPosition
make up the selection
range. Selection must always be specified in terms of begin <= end, but
anchor
may be less than, equal to, or greater than the
caretPosition
. Depending on how the user selects text,
the caretPosition might represent the lower or upper bound of the selection.getCaretPosition()
public java.lang.String getText(int start, int end)
start
- must be a value between 0 and end - 1.end
- must be less than or equal to the lengthpublic void appendText(java.lang.String text)
text
- a non null Stringpublic void insertText(int index, java.lang.String text)
index
- The location to insert the text.text
- The text to insert.public void deleteText(IndexRange range)
range
- deleteText(int, int)
public void deleteText(int start, int end)
start
- end
- public void replaceText(IndexRange range, java.lang.String text)
range
- text
- replaceText(int, int, String)
public void replaceText(int start, int end, java.lang.String text)
start
- end
- text
- public void cut()
public void copy()
public void paste()
public void selectBackward()
public void selectForward()
public void previousWord()
public void nextWord()
public void endOfNextWord()
public void selectPreviousWord()
public void selectNextWord()
public void selectEndOfNextWord()
public void selectAll()
public void home()
public void end()
public void selectHome()
public void selectEnd()
public boolean deletePreviousChar()
public boolean deleteNextChar()
public void forward()
public void backward()
public void positionCaret(int pos)
pos
. This
function will also clear the selection.public void selectPositionCaret(int pos)
pos
and 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.public void selectRange(int anchor, int caretPosition)
public void extendSelection(int pos)
public void clear()
public void deselect()
public void replaceSelection(java.lang.String replacement)
Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. Use is subject to