T - the data type of the value in the FormattedTextFieldpublic class FormattedTextField<T> extends javafx.scene.control.TextField implements Editor<T>
FormattedTextField is a TextField that can restrict the user input by applying a pattern to separate
the input string into groups, then define PatternVerifiers to verify/restrict the input for each group.
Let's start by looking an example for an IPv4 address field.
FormattedTextField<String> field = new FormattedTextField<>();
field.setPattern("h.h.h.h");
field.getPatternVerifiers().put('h', new IntegerRangeGroupVerifier(0, 255));
The pattern is "h.h.h.h", it means there are four groups, separated by dots. It doesn?t really matter which letter or letters you use here because it is just a name for the group. In this case, four groups have the same name "h". Then in the PatternVerifiers map, we added a verifier for the group named "h". The verifier will enforce the input string for the group is a number and it must be between 0 and 255.
| Type | Property and Description |
|---|---|
javafx.beans.property.BooleanProperty |
autoAdvance |
javafx.beans.property.BooleanProperty |
autoReformat |
javafx.beans.property.BooleanProperty |
autoSelectAll |
javafx.beans.property.BooleanProperty |
clearButtonVisible |
javafx.beans.property.BooleanProperty |
comboBoxLike |
javafx.beans.property.ObjectProperty<T> |
defaultValue |
javafx.beans.property.StringProperty |
pattern |
javafx.beans.property.StringProperty |
regularExpression |
javafx.beans.property.ObjectProperty<SpinnerStyle> |
spinnerStyle |
javafx.beans.property.BooleanProperty |
spinnersVisible |
javafx.beans.property.ObjectProperty<javafx.util.StringConverter<T>> |
stringConverter |
javafx.beans.property.ObjectProperty<T> |
value |
alignmentProperty, onActionProperty, prefColumnCountPropertyanchorProperty, caretPositionProperty, editableProperty, fontProperty, lengthProperty, promptTextProperty, selectedTextProperty, selectionProperty, textPropertycontextMenuProperty, skinClassNameProperty, skinProperty, tooltipPropertybackgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, heightProperty, insetsProperty, maxHeightProperty, maxWidthProperty, minHeightProperty, minWidthProperty, opaqueInsetsProperty, paddingProperty, prefHeightProperty, prefWidthProperty, scaleShapeProperty, shapeProperty, snapToPixelProperty, widthPropertyimpl_traversalEngineProperty, needsLayoutPropertyblendModeProperty, boundsInLocalProperty, boundsInParentProperty, cacheHintProperty, cacheProperty, clipProperty, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, focusedProperty, focusTraversableProperty, hoverProperty, idProperty, impl_showMnemonicsProperty, impl_treeVisibleProperty, inputMethodRequestsProperty, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParentTransformProperty, localToSceneTransformProperty, managedProperty, mouseTransparentProperty, nodeOrientationProperty, 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, pickOnBoundsProperty, pressedProperty, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, styleProperty, translateXProperty, translateYProperty, translateZProperty, visibleProperty| Constructor and Description |
|---|
FormattedTextField()
Creates a
FormattedTextField with a null value. |
FormattedTextField(T value)
Creates a
FormattedTextField with an initial value. |
| Modifier and Type | Method and Description |
|---|---|
javafx.scene.Node |
asSpinner()
Return a node which can be used as a spinner control.
|
javafx.scene.Node |
asSpinner(SpinnerStyle style)
Return a node which can be used as a spinner control.
|
javafx.beans.property.BooleanProperty |
autoAdvanceProperty() |
javafx.beans.property.BooleanProperty |
autoReformatProperty() |
javafx.beans.property.BooleanProperty |
autoSelectAllProperty() |
boolean |
cancelEdit()
Cancels the edit to reset the text using the previous value.
|
void |
clear()
Set the value to the default value or null if the default value was not set.
|
javafx.beans.property.BooleanProperty |
clearButtonVisibleProperty() |
javafx.beans.property.BooleanProperty |
comboBoxLikeProperty() |
boolean |
commitEdit()
Commits the edit and set the value.
|
protected javafx.scene.control.Button |
createDecreaseSpinnerButton() |
protected jidefx.scene.control.decoration.Decorator<javafx.scene.control.Button> |
createDecreaseSpinnerDecorator()
Creates the decorator for the decrease button.
|
protected javafx.scene.control.Button |
createIncreaseSpinnerButton() |
protected jidefx.scene.control.decoration.Decorator<javafx.scene.control.Button> |
createIncreaseSpinnerDecorator()
Creates the decorator for the increase button.
|
static FormattedTextField<java.lang.String> |
createIPv4Field()
A static method which will create a FormattedTextField for IPv4 address.
|
void |
decreaseValue()
Decreases the value of the current group by a unit.
|
javafx.beans.property.ObjectProperty<T> |
defaultValueProperty() |
protected void |
enableAutoRepeat(javafx.scene.control.Button button)
Installs the <code>AutoRepeatButtonUtils</code> to the spinner buttons.
|
void |
endOfNextWord()
Moves the caret to the end of the current group or beginning of next group.
|
protected T |
fromString(java.lang.String text) |
T |
getDefaultValue()
Gets the default value.
|
protected java.util.regex.Matcher |
getGroupMatcher(java.lang.String newText) |
java.lang.String |
getGroupText(int groupIndex)
Gets the text of the group at the specified index.
|
java.lang.String |
getGroupText(java.lang.String groupName)
Gets the text of the group with the specified name.
|
java.lang.String |
getPattern()
Gets the pattern.
|
javafx.collections.ObservableMap<java.lang.String,javafx.util.Callback<java.lang.String,java.lang.Boolean>> |
getPatternVerifiers()
Gets the verifiers for the group.
|
java.lang.String |
getRegularExpression()
Gets the regular expression pattern.
|
SpinnerStyle |
getSpinnerStyle()
Gets the SpinnerStyle.
|
javafx.util.StringConverter<T> |
getStringConverter()
Gets the StringConverter.
|
T |
getValue()
Gets the value represented by this
FormattedTextField. |
void |
increaseValue()
Increases the value of the current group by a unit.
|
protected void |
initializePattern()
Subclass can override this method to initializes the pattern, pattern verifiers and the StringConverter.
|
protected void |
initializeStyle()
Adds or removes style from the getStyleClass.
|
protected void |
initializeTextField()
Do some initialization of the text field, such as set the PopupContentFactory.
|
void |
installAdjustmentMouseHandler(javafx.scene.Node node)
Installs a mouse handler to the node so that when user drags the node, the value in the FormattedTextField will
be adjusted.
|
void |
installAdjustmentMouseHandler(javafx.scene.Node node,
int units)
Installs a mouse handler to the node so that when user drags the node, the value in the FormattedTextField will
be adjusted.
|
void |
installAdjustmentMouseHandler(javafx.scene.Node node,
int units,
double threshold)
Installs a mouse handler to the node so that when user drags the node, the value in the FormattedTextField will
be adjusted.
|
boolean |
isAutoAdvance()
Checks if the auto-advance flag.
|
boolean |
isAutoReformat()
Checks if the auto-reformat flag.
|
boolean |
isAutoSelectAll()
Checks whether the text will be all selected after setValue is called.
|
boolean |
isClearButtonVisible()
Checsk if the clear button is visible.
|
boolean |
isComboBoxLike()
Gets the value of the property comboBoxLike.
|
boolean |
isSpinnersVisible()
Checks if the spinner buttons are visible.
|
void |
nextWord()
Moves the caret to the end of the current group or beginning of next group.
|
javafx.beans.value.ObservableValue<T> |
observableValue()
An observable value of the editor so that one can listen to the value change.
|
javafx.beans.property.StringProperty |
patternProperty() |
void |
previousWord()
Moves the caret to the beginning of the current group or the end of the previous group.
|
boolean |
processKeyCode(javafx.scene.input.KeyEvent event)
Increases or decreases the value in the current group.
|
protected void |
registerListeners() |
javafx.beans.property.StringProperty |
regularExpressionProperty() |
void |
replaceSelection(java.lang.String replacement) |
void |
replaceText(int start,
int end,
java.lang.String text) |
boolean |
selectCurrentGroup()
Selects the group.
|
void |
selectEndOfNextWord()
For the grouped-based field, it will move the caret to the end of current group or the beginning of the next
group.
|
boolean |
selectNextGroup()
Selects the next group.
|
void |
selectNextWord()
For the grouped-based field, it will move the caret to the end of current group or the beginning of the next
group.
|
boolean |
selectPreviousGroup()
Selects the next group.
|
void |
selectPreviousWord()
Moves the caret to the beginning of current group or the end of the previous group.
|
void |
setAutoAdvance(boolean autoAdvance)
Sets the auto-advance flag.
|
void |
setAutoReformat(boolean autoReformat)
Sets the auto-reformat flag.
|
void |
setAutoSelectAll(boolean autoSelectAll)
Sets the flag whether to select all after the setValue is called.
|
void |
setClearButtonVisible(boolean clearButtonVisible)
Shows or hides the clear button.
|
void |
setComboBoxLike(java.lang.Boolean comboBoxLie)
Sets the value of the property comboBoxLike.
|
void |
setDefaultValue(T value)
Sets the default value.
|
void |
setPattern(java.lang.String pattern)
Sets the pattern.
|
void |
setRegularExpression(java.lang.String regex)
Sets the regular expression pattern.
|
void |
setSpinnerStyle(SpinnerStyle spinnerStyle)
Sets the SpinnerStyle.
|
void |
setSpinnersVisible(boolean spinnersVisible)
Sets the spinner buttons visible.
|
void |
setStringConverter(javafx.util.StringConverter<T> stringConverter)
Sets the StringConverter that will convert the value from/to String.
|
void |
setValue(T value)
Sets the value represented by this
FormattedTextField. |
javafx.beans.property.ObjectProperty<SpinnerStyle> |
spinnerStyleProperty() |
javafx.beans.property.BooleanProperty |
spinnersVisibleProperty() |
javafx.beans.property.ObjectProperty<javafx.util.StringConverter<T>> |
stringConverterProperty() |
protected boolean |
supportFromString() |
protected java.lang.String |
toString(T value) |
void |
uninstallAdjustmentMouseHandler(javafx.scene.Node node)
Uninstalls the mouse handler added by
installAdjustmentMouseHandler(Node). |
javafx.beans.property.ObjectProperty<T> |
valueProperty() |
alignmentProperty, createDefaultSkin, getAlignment, getCharacters, getClassCssMetaData, getControlCssMetaData, getOnAction, getPrefColumnCount, onActionProperty, prefColumnCountProperty, setAlignment, setOnAction, setPrefColumnCountanchorProperty, appendText, backward, caretPositionProperty, copy, cut, deleteNextChar, deletePreviousChar, deleteText, deleteText, deselect, editableProperty, end, extendSelection, fontProperty, forward, getAnchor, getCaretPosition, getContent, getFont, getLength, getPromptText, getSelectedText, getSelection, getText, getText, home, insertText, isEditable, lengthProperty, paste, positionCaret, promptTextProperty, replaceText, selectAll, selectBackward, selectedTextProperty, selectEnd, selectForward, selectHome, selectionProperty, selectPositionCaret, selectRange, setEditable, setFont, setPromptText, setText, textPropertycomputeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, getBaselineOffset, getContextMenu, getCssMetaData, getSkin, getTooltip, getUserAgentStylesheet, impl_cssGetFocusTraversableInitialValue, impl_getAccessible, impl_processCSS, isResizable, layoutChildren, setContextMenu, setSkin, setTooltip, skinClassNameProperty, skinProperty, tooltipPropertybackgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getWidth, heightProperty, impl_computeContains, impl_computeGeomBounds, impl_computeLayoutBounds, impl_createPGNode, impl_notifyLayoutBoundsChanged, impl_pickNodeLocal, impl_updatePG, 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, widthPropertygetChildren, getChildrenUnmodifiable, getImpl_traversalEngine, getManagedChildren, getStylesheets, impl_getAllParentStylesheets, impl_processMXNode, impl_traversalEngineProperty, isNeedsLayout, layout, lookup, needsLayoutProperty, requestLayout, requestParentLayout, setImpl_traversalEngine, setNeedsLayoutaddEventFilter, addEventHandler, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, containsBounds, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, fireEvent, focusedProperty, focusTraversableProperty, 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, impl_clearDirty, impl_computeIntersects, impl_cssGetCursorInitialValue, impl_geomChanged, impl_getLeafTransform, impl_getMatchingStyles, impl_getPGNode, impl_getPivotX, impl_getPivotY, impl_getPivotZ, impl_getStyleMap, impl_hasTransforms, impl_intersects, impl_intersectsBounds, impl_isDirty, impl_isDirtyEmpty, impl_isShowMnemonics, impl_isTreeVisible, impl_layoutBoundsChanged, impl_markDirty, impl_pickNode, impl_processCSS, impl_reapplyCSS, impl_setShowMnemonics, impl_setStyleMap, impl_showMnemonicsProperty, impl_syncPGNode, impl_transformsChanged, impl_traverse, impl_treeVisibleProperty, 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, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, 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, screenToLocal, screenToLocal, screenToLocal, 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, visiblePropertyclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcreateEditorpublic javafx.beans.property.StringProperty patternProperty
getPattern(),
setPattern(String)public javafx.beans.property.StringProperty regularExpressionProperty
public javafx.beans.property.ObjectProperty<javafx.util.StringConverter<T>> stringConverterProperty
public javafx.beans.property.ObjectProperty<T> valueProperty
getValue(),
setValue(T)public javafx.beans.property.ObjectProperty<T> defaultValueProperty
getDefaultValue(),
setDefaultValue(T)public javafx.beans.property.BooleanProperty autoAdvanceProperty
isAutoAdvance(),
setAutoAdvance(boolean)public javafx.beans.property.BooleanProperty autoReformatProperty
isAutoReformat(),
setAutoReformat(boolean)public javafx.beans.property.BooleanProperty autoSelectAllProperty
isAutoSelectAll(),
setAutoSelectAll(boolean)public javafx.beans.property.BooleanProperty spinnersVisibleProperty
isSpinnersVisible(),
setSpinnersVisible(boolean)public javafx.beans.property.BooleanProperty clearButtonVisibleProperty
public javafx.beans.property.BooleanProperty comboBoxLikeProperty
isComboBoxLike(),
setComboBoxLike(Boolean)public javafx.beans.property.ObjectProperty<SpinnerStyle> spinnerStyleProperty
getSpinnerStyle(),
setSpinnerStyle(SpinnerStyle)public FormattedTextField()
FormattedTextField with a null value. This constrcutor will call initializePattern(),
initializeTextField(), initializeStyle(), registerListeners() in order, at last, the
setValue(null) method. Subclass can override those methods to do its own initialization.public FormattedTextField(T value)
FormattedTextField with an initial value. This constrcutor will call initializeStyle(), initializePattern(), initializeTextField(), registerListeners()
in order, at last, the setValue method. Subclass can override those methods to do its own initialization.value - the initial value.protected void initializeStyle()
protected void initializeTextField()
protected void initializePattern()
public javafx.collections.ObservableMap<java.lang.String,javafx.util.Callback<java.lang.String,java.lang.Boolean>> getPatternVerifiers()
protected void registerListeners()
public void clear()
clear in class javafx.scene.control.TextInputControlpublic boolean cancelEdit()
public boolean commitEdit()
protected java.lang.String toString(T value)
protected T fromString(java.lang.String text)
protected boolean supportFromString()
public void previousWord()
previousWord in class javafx.scene.control.TextInputControlpublic void nextWord()
nextWord in class javafx.scene.control.TextInputControlpublic void endOfNextWord()
nextWord().endOfNextWord in class javafx.scene.control.TextInputControlpublic void selectPreviousWord()
selectPreviousWord in class javafx.scene.control.TextInputControlpublic void selectNextWord()
For position-based field, it will simply call super.
selectNextWord in class javafx.scene.control.TextInputControlpublic void selectEndOfNextWord()
selectNextWord().
For position-based field, it will simply call super.
selectEndOfNextWord in class javafx.scene.control.TextInputControlpublic boolean selectPreviousGroup()
Valid only for the group-based field.
public boolean selectNextGroup()
Valid only for the group-based field.
public boolean selectCurrentGroup()
public boolean processKeyCode(javafx.scene.input.KeyEvent event)
event - the KeyEvent.public void increaseValue()
public void decreaseValue()
public javafx.beans.property.StringProperty patternProperty()
getPattern(),
setPattern(String)public java.lang.String getPattern()
public void setPattern(java.lang.String pattern)
pattern - a new patternpublic javafx.beans.property.StringProperty regularExpressionProperty()
public java.lang.String getRegularExpression()
public void setRegularExpression(java.lang.String regex)
In most cases, you don't need to call this method because we will automatically create the regular expression
using the pattern from the setPattern method. If the groups are separated by a non-group characters, we should
have no problem figuring out. Even if the groups are adjacent, we will check if the verifier implements PatternVerifier.Length. If yes, we will use the min/maxLength as additional information to help us figuring it
out. If none of the efforts works, we will at last throw an IllegalStateException in the runtime. When you saw
this exception, you can then call this method to help us with the regular expression, or you can improve the
pattern or the verifier.
regex - a new regular expression pattern with the group information.public javafx.beans.property.ObjectProperty<javafx.util.StringConverter<T>> stringConverterProperty()
public javafx.util.StringConverter<T> getStringConverter()
public void setStringConverter(javafx.util.StringConverter<T> stringConverter)
stringConverter - the new StringConverter.public javafx.beans.property.ObjectProperty<T> valueProperty()
getValue(),
setValue(T)public T getValue()
FormattedTextField. The value is only used by the group-based field.public void setValue(T value)
FormattedTextField. The value is only used by the group-based field.
Usually if you set a value, you also want to set a format. For the non-group-based field, setValue would behave
the same as the setText method.public javafx.beans.value.ObservableValue<T> observableValue()
EditorobservableValue in interface Editor<T>public javafx.beans.property.ObjectProperty<T> defaultValueProperty()
getDefaultValue(),
setDefaultValue(T)public T getDefaultValue()
public void setDefaultValue(T value)
value - the new default value.public javafx.beans.property.BooleanProperty autoAdvanceProperty()
isAutoAdvance(),
setAutoAdvance(boolean)public boolean isAutoAdvance()
public void setAutoAdvance(boolean autoAdvance)
autoAdvance - a new auto-advance flagpublic javafx.beans.property.BooleanProperty autoReformatProperty()
isAutoReformat(),
setAutoReformat(boolean)public boolean isAutoReformat()
public void setAutoReformat(boolean autoReformat)
autoReformat - a new auto-reformat flagpublic javafx.beans.property.BooleanProperty autoSelectAllProperty()
isAutoSelectAll(),
setAutoSelectAll(boolean)public boolean isAutoSelectAll()
public void setAutoSelectAll(boolean autoSelectAll)
autoSelectAll - true to select all after the setValue is called. Otherwise false.protected java.util.regex.Matcher getGroupMatcher(java.lang.String newText)
public java.lang.String getGroupText(int groupIndex)
groupIndex - the group index.public java.lang.String getGroupText(java.lang.String groupName)
groupName - the group name.public void replaceText(int start,
int end,
java.lang.String text)
replaceText in class javafx.scene.control.TextInputControlpublic void replaceSelection(java.lang.String replacement)
replaceSelection in class javafx.scene.control.TextInputControlprotected void enableAutoRepeat(javafx.scene.control.Button button)
button - one of the two spinner buttons.protected jidefx.scene.control.decoration.Decorator<javafx.scene.control.Button> createIncreaseSpinnerDecorator()
protected javafx.scene.control.Button createIncreaseSpinnerButton()
protected jidefx.scene.control.decoration.Decorator<javafx.scene.control.Button> createDecreaseSpinnerDecorator()
protected javafx.scene.control.Button createDecreaseSpinnerButton()
public javafx.beans.property.BooleanProperty spinnersVisibleProperty()
isSpinnersVisible(),
setSpinnersVisible(boolean)public boolean isSpinnersVisible()
public void setSpinnersVisible(boolean spinnersVisible)
spinnersVisible - true or false.public javafx.beans.property.BooleanProperty clearButtonVisibleProperty()
public boolean isClearButtonVisible()
public void setClearButtonVisible(boolean clearButtonVisible)
clearButtonVisible - true or false.public javafx.beans.property.BooleanProperty comboBoxLikeProperty()
isComboBoxLike(),
setComboBoxLike(Boolean)public boolean isComboBoxLike()
public void setComboBoxLike(java.lang.Boolean comboBoxLie)
public void installAdjustmentMouseHandler(javafx.scene.Node node)
Because the singleton nature of this feature, we only support one adjustment node per field. Installing the mouse handler for another node will remove the previous mouse handler.
node - the node. It is usually the label node for the field. For example, you have a Label("Opacity") then a
field for the opacity value. The node here would be the label.public void installAdjustmentMouseHandler(javafx.scene.Node node,
int units)
Because the singleton nature of this feature, we only support one adjustment node per field. Installing the mouse handler for another node will remove the previous mouse handler.
node - the node. It is usually the label node for the field. For example, you have a Label("Opacity") then
a field for the opacity value. The node here would be the label.units - how many times the value will be adjusted when there is a mouse dragged event. It should be a value
greater than or equal to 1.public void installAdjustmentMouseHandler(javafx.scene.Node node,
int units,
double threshold)
Because the singleton nature of this feature, we only support one adjustment node per field. Installing the mouse handler for another node will remove the previous mouse handler.
node - the node. It is usually the label node for the field. For example, you have a Label("Opacity")
then a field for the opacity value. The node here would be the label.units - how many units the value will be adjusted when there is a mouse dragged event. It should be a
value greater than or equal to 1.threshold - it will determine how far the mouse movement will trigger a value adjustment. The default value
is 1. Larger means longer distance. The larger the value, the longer distance the mouse has to
travel before a value adjustment is triggered.public void uninstallAdjustmentMouseHandler(javafx.scene.Node node)
installAdjustmentMouseHandler(Node).node - the node where the mouse handler was added.public javafx.scene.Node asSpinner()
setSpinnerStyle(SpinnerStyle) call especially when the
spinner buttons are outside the field.public javafx.scene.Node asSpinner(SpinnerStyle style)
setSpinnerStyle(SpinnerStyle) call especially when the
spinner buttons are outside the field.style - the SpinnerStylepublic static FormattedTextField<java.lang.String> createIPv4Field()
public javafx.beans.property.ObjectProperty<SpinnerStyle> spinnerStyleProperty()
getSpinnerStyle(),
setSpinnerStyle(SpinnerStyle)public SpinnerStyle getSpinnerStyle()
public void setSpinnerStyle(SpinnerStyle spinnerStyle)
spinnerStyle - the new SpinnerStyle.asSpinner()