- All Implemented Interfaces:
MFXMenuControl,Validated,Styleable,EventTarget,Skinnable
- Direct Known Subclasses:
MFXComboBox,MFXDatePicker,MFXPasswordField
Unlike Swing and JavaFX (which copied Swing duh), I followed Google's Material Design guidelines. They do not have anything like a Label but only TextFields. After all, a TextField has all the features a Label has and even more.
MFXTextField allows you to make it behave like a Label by setting the TextInputControl.editableProperty() and
the selectableProperty() to false.
Allows you to specify up to two icons (leading and trailing) and the gap between them and the text.
Unlike JavaFX's TextField, it also allows to easily change the text color (even with CSS).
But... the most important and requested feature is the floating text. You can decide between four modes: DISABLED (no floating text), INLINE (the floating text is inside the field), BORDER (the floating text is placed on the field's border, and ABOVE (the floating text is outside the field, above it).
You can also specify the distance between the text and the floating text (for INLINE and ABOVE modes).
In ABOVE and BORDER modes you can control the floating text distance from the origin by modifying the left padding in CSS
or by modifying the borderGapProperty().
MFXTextField now also introduces a new PseudoClass, ":floating" that activates
when the floating text node is floating.
As with the previous MFXTextField it's also possible to specify the maximum number of characters for the text.
Some little side notes on the floating text:
Please note that because of the extra node to show the floating text, MFXTextField now takes more space.
There are several things you can do to make it more compact:
1) You can lower the floatingTextGapProperty() (for INLINE and ABOVE mode)
2) You can lower the padding (set in CSS) but I would not recommend it to be honest, a little bit of padding makes the control more appealing
3) You can switch mode. The DISABLED mode requires the least space of course. The BORDER mode requires some more space, the ABOVE mode is visually equal to the DISABLED state but keep in mind that the floating text is still there, above the field, and the INLINE mode is the one that requires the most space.
The layout strategy now should be super solid and efficient, making possible to switch float modes even at runtime. Note 1: in case of BORDER mode to make it really work as intended a condition must be met. The background colors of the text field, the floating text and the parent container of the field must be the same. You see, on the material.io website you can see the floating text cut the field's borders but that's not what it is happening. If you look more carefully the demo background is white, and the field's background as well. The floating text just sits on top of the field's border and has the same background color, creating that 'cut' effect. Note 2: since JavaFX devs are shitheads making everything private/readonly/final, the only way to make the caret position and the selection consistent is to delegate related methods to theBoundTextField instance.
This means that most if not all methods related to the caret and the selection WON'T work, instead you should use
the methods that start with "delegate", e.g. delegateCaretPositionProperty(), delegateSelectionProperty(), etc...
Also note that the same applies to the focus property, delegateFocusedProperty().
Some methods that do not start with "delegate" may work as they've been overridden to be delegates,
e.g. positionCaret(int), selectRange(int, int), etc...
If that's not the case then maybe I missed something so please report it back and I'll see if it's fixable.
Considering that the other option would have been re-implementing a TextField completely from scratch (really hard task) this is the best option as of now. Even just a custom skin would not work (yep I tried) since black magic is involved in the default one, better not mess with that or something will break for sure, yay for spaghetti coding JavaFX devs :D
Note 3: Since MFXTextFields (and all subclasses) are basically a wrapper for a TextField, and considered how focus works for them. To make focus behavior consistent in CSS, MFXTextField introduces a new PseudoClass "focus-within" which will be activated every time the inner TextField is focused and deactivated when it loses focus-
Property Summary
PropertiesTypePropertyDescriptionSpecifies whether the field is editable.Specifies whether the floating text positioning is animated.ForFloatMode.BORDERandFloatMode.ABOVEmodes, this specifies the distance from the control's x origin (padding not included).Specifies whether the caret should be visible.Specifies theBoundTextFieldanchor position.Specifies theBoundTextFieldcaret position.Specifies whether theBoundTextFieldis focused.Delegates toBoundTextField, seeTextInputControl.redoableProperty().Specifies theBoundTextFieldselected text.Specifies theBoundTextFieldselection.Specifies theBoundTextFieldtext formatter.Delegates toBoundTextField, seeTextInputControl.undoableProperty().Specifies if the floating text node is currently floating or not.ForFloatMode.INLINEmode, this specifies the gap between the floating text node and the input field node.Specifies the text of the floating text node.Specifies how the floating text is positioned when floating.Specifies the gap between the input field and the icons.Specifies the icon placed before the input field.Specifies the gap between the field and the measure unit label.Specifies the unit of measure of the field.Specifies whether the floating text node should be scaled or not when the float mode is set toFloatMode.ABOVE.Specifies whether selection is allowed.Specifies the text color.Specifies the maximum number of characters the field's text can have.Specifies the icon placed after the input field.Properties inherited from class javafx.scene.control.TextField
alignment, onAction, prefColumnCountProperties inherited from class javafx.scene.control.TextInputControl
anchor, caretPosition, editable, font, length, promptText, redoable, selectedText, selection, textFormatter, text, undoableProperties inherited from class javafx.scene.control.Control
contextMenu, skin, tooltipProperties inherited from class javafx.scene.layout.Region
background, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, widthProperties inherited from class javafx.scene.Parent
needsLayoutProperties inherited from class 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, viewOrder, visible -
Nested Class Summary
Nested classes/interfaces inherited from class javafx.scene.control.TextInputControl
TextInputControl.Content -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final BoundTextFieldprotected MFXContextMenustatic final Colorprotected final BooleanPropertyprotected final MFXValidatorFields inherited from class javafx.scene.control.TextField
DEFAULT_PREF_COLUMN_COUNTFields inherited from class javafx.scene.layout.Region
USE_COMPUTED_SIZE, USE_PREF_SIZEFields inherited from class javafx.scene.Node
BASELINE_OFFSET_SAME_AS_HEIGHTFields inherited from interface io.github.palexdev.materialfx.validation.Validated
INVALID_PSEUDO_CLASS -
Constructor Summary
ConstructorsConstructorDescriptionMFXTextField(String text) MFXTextField(String text, String promptText) MFXTextField(String text, String promptText, String floatingText) -
Method Summary
Modifier and TypeMethodDescriptionSpecifies whether the field is editable.Specifies whether the floating text positioning is animated.static MFXTextFieldasLabel()CallsasLabel(String)with empty text.static MFXTextFieldCallsasLabel(String, String)with empty promptText.static MFXTextFieldCallsasLabel(String, String, String)with empty floatingText.static MFXTextFieldCreates a text field that is not editable nor selectable to act just like a label.voidbackward()ForFloatMode.BORDERandFloatMode.ABOVEmodes, this specifies the distance from the control's x origin (padding not included).Specifies whether the caret should be visible.voidclear()voidcopy()protected Skin<?>voidcut()voidSpecifies theBoundTextFieldanchor position.Specifies theBoundTextFieldcaret position.Specifies whether theBoundTextFieldis focused.intintbooleanbooleanbooleanDelegates toBoundTextField, seeTextInputControl.redoableProperty().Specifies theBoundTextFieldselected text.Specifies theBoundTextFieldselection.voiddelegateSetTextFormatter(TextFormatter<?> textFormatter) Specifies theBoundTextFieldtext formatter.Delegates toBoundTextField, seeTextInputControl.undoableProperty().voiddeselect()voidend()voidvoidextendSelection(int pos) Specifies if the floating text node is currently floating or not.ForFloatMode.INLINEmode, this specifies the gap between the floating text node and the input field node.Specifies the text of the floating text node.Specifies how the floating text is positioned when floating.voidforward()doubleGets the value of the property borderGap.booleanGets the value of the property caretVisible.static List<CssMetaData<? extends Styleable,?>> List<CssMetaData<? extends Styleable,?>> Gets the value of the property floatingText.doubleGets the value of the property floatingTextGap.Gets the value of the property floatMode.doubleGets the value of the property graphicTextGap.Gets the value of the property leadingIcon.Gets the value of the property measureUnit.doubleGets the value of the property measureUnitGap.Gets the value of the property textFill.intGets the value of the property textLimit.Gets the value of the property trailingIcon.Specifies the gap between the input field and the icons.voidhome()booleanGets the value of the property allowEdit.booleanGets the value of the property animated.booleanGets the value of the property floating.booleanGets the value of the property selectable.Specifies the icon placed before the input field.Specifies the gap between the field and the measure unit label.Specifies the unit of measure of the field.voidnextWord()voidpaste()voidpositionCaret(int pos) voidvoidreplaceSelection(String replacement) booleanSpecifies whether the floating text node should be scaled or not when the float mode is set toFloatMode.ABOVE.Specifies whether selection is allowed.voidvoidvoidvoidvoidvoidvoidvoidselectPositionCaret(int pos) voidvoidselectRange(int anchor, int caretPosition) voidsetAllowEdit(boolean allowEdit) Sets the value of the property allowEdit.voidsetAnimated(boolean animated) Sets the value of the property animated.voidsetBorderGap(double borderGap) Sets the value of the property borderGap.voidsetCaretVisible(boolean caretVisible) Sets the value of the property caretVisible.voidsetFloatingText(String floatingText) Sets the value of the property floatingText.voidsetFloatingTextGap(double floatingTextGap) Sets the value of the property floatingTextGap.voidsetFloatMode(FloatMode floatMode) Sets the value of the property floatMode.voidsetGraphicTextGap(double graphicTextGap) Sets the value of the property graphicTextGap.voidsetLeadingIcon(Node leadingIcon) Sets the value of the property leadingIcon.voidsetMeasureUnit(String measureUnit) Sets the value of the property measureUnit.voidsetMeasureUnitGap(double measureUnitGap) Sets the value of the property measureUnitGap.voidsetScaleOnAbove(boolean scaleOnAbove) Sets the value of the property scaleOnAbove.voidsetSelectable(boolean selectable) Sets the value of the property selectable.voidsetTextFill(Color textFill) Sets the value of the property textFill.voidsetTextLimit(int textLimit) Sets the value of the property textLimit.voidsetTrailingIcon(Node trailingIcon) Sets the value of the property trailingIcon.Specifies the text color.Specifies the maximum number of characters the field's text can have.Specifies the icon placed after the input field.Methods inherited from class javafx.scene.control.TextField
alignmentProperty, getAlignment, getCharacters, getOnAction, getPrefColumnCount, onActionProperty, prefColumnCountProperty, setAlignment, setOnAction, setPrefColumnCountMethods inherited from class javafx.scene.control.TextInputControl
anchorProperty, appendText, cancelEdit, caretPositionProperty, commitValue, deleteNextChar, deletePreviousChar, deleteText, deleteText, editableProperty, executeAccessibleAction, fontProperty, getAnchor, getCaretPosition, getContent, getFont, getLength, getPromptText, getSelectedText, getSelection, getText, getText, getTextFormatter, insertText, isEditable, isRedoable, isUndoable, lengthProperty, promptTextProperty, queryAccessibleAttribute, redo, redoableProperty, replaceText, replaceText, selectedTextProperty, selectionProperty, setEditable, setFont, setPromptText, setText, setTextFormatter, textFormatterProperty, textProperty, undo, undoablePropertyMethods inherited from class javafx.scene.control.Control
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, getBaselineOffset, getContextMenu, getCssMetaData, getInitialFocusTraversable, getSkin, getTooltip, isResizable, layoutChildren, setContextMenu, setSkin, setTooltip, skinProperty, tooltipPropertyMethods inherited from class javafx.scene.layout.Region
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, 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 inherited from class javafx.scene.Parent
getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, requestLayout, requestParentLayout, setNeedsLayout, updateBoundsMethods inherited from class 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, 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, 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, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visiblePropertyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.github.palexdev.materialfx.controls.base.MFXMenuControl
isContextMenuDisabled, setContextMenuDisabledMethods inherited from interface javafx.css.Styleable
getStyleableNodeMethods inherited from interface io.github.palexdev.materialfx.validation.Validated
isValid, updateInvalid, validate
-
Property Details
-
delegateTextFormatter
Specifies theBoundTextFieldtext formatter. -
delegateAnchor
Specifies theBoundTextFieldanchor position. -
delegateCaretPosition
Specifies theBoundTextFieldcaret position. -
delegateSelectedText
Specifies theBoundTextFieldselected text. -
delegateSelection
Specifies theBoundTextFieldselection. -
delegateRedoable
Delegates toBoundTextField, seeTextInputControl.redoableProperty(). -
delegateUndoable
Delegates toBoundTextField, seeTextInputControl.undoableProperty(). -
delegateFocused
Specifies whether theBoundTextFieldis focused. -
selectable
Specifies whether selection is allowed.- See Also:
-
leadingIcon
Specifies the icon placed before the input field.- See Also:
-
trailingIcon
Specifies the icon placed after the input field.- See Also:
-
floatingText
Specifies the text of the floating text node.- See Also:
-
floating
Specifies if the floating text node is currently floating or not.- See Also:
-
measureUnit
Specifies the unit of measure of the field. This is useful of course when dealing with numeric fields that represent for example: weight, volume, length and so on...- See Also:
-
allowEdit
Specifies whether the field is editable.This property is bound bidirectionally to
TextInputControl.editableProperty(), it's here just to be set via CSS.- See Also:
-
animated
Specifies whether the floating text positioning is animated.- See Also:
-
borderGap
ForFloatMode.BORDERandFloatMode.ABOVEmodes, this specifies the distance from the control's x origin (padding not included).- See Also:
-
caretVisible
Specifies whether the caret should be visible.- See Also:
-
floatMode
Specifies how the floating text is positioned when floating.- See Also:
-
floatingTextGap
ForFloatMode.INLINEmode, this specifies the gap between the floating text node and the input field node. -
graphicTextGap
Specifies the gap between the input field and the icons.- See Also:
-
scaleOnAbove
Specifies whether the floating text node should be scaled or not when the float mode is set toFloatMode.ABOVE.- See Also:
-
measureUnitGap
Specifies the gap between the field and the measure unit label.- See Also:
-
textFill
Specifies the text color.- See Also:
-
textLimit
Specifies the maximum number of characters the field's text can have.- See Also:
-
-
Field Details
-
boundField
-
DEFAULT_TEXT_COLOR
-
floating
-
validator
-
contextMenu
-
-
Constructor Details
-
MFXTextField
public MFXTextField() -
MFXTextField
-
MFXTextField
-
MFXTextField
-
-
Method Details
-
asLabel
CallsasLabel(String)with empty text. -
asLabel
CallsasLabel(String, String)with empty promptText. -
asLabel
CallsasLabel(String, String, String)with empty floatingText. -
asLabel
Creates a text field that is not editable nor selectable to act just like a label. -
defaultContextMenu
public void defaultContextMenu() -
getMFXContextMenu
- Specified by:
getMFXContextMenuin interfaceMFXMenuControl- Returns:
- the context menu of the control
-
createDefaultSkin
- Overrides:
createDefaultSkinin classTextField
-
getControlCssMetaData
- Overrides:
getControlCssMetaDatain classTextField
-
getUserAgentStylesheet
- Overrides:
getUserAgentStylesheetin classRegion
-
cut
public void cut()- Overrides:
cutin classTextInputControl
-
copy
public void copy()- Overrides:
copyin classTextInputControl
-
paste
public void paste()- Overrides:
pastein classTextInputControl
-
selectBackward
public void selectBackward()- Overrides:
selectBackwardin classTextInputControl
-
selectForward
public void selectForward()- Overrides:
selectForwardin classTextInputControl
-
previousWord
public void previousWord()- Overrides:
previousWordin classTextInputControl
-
nextWord
public void nextWord()- Overrides:
nextWordin classTextInputControl
-
endOfNextWord
public void endOfNextWord()- Overrides:
endOfNextWordin classTextInputControl
-
selectPreviousWord
public void selectPreviousWord()- Overrides:
selectPreviousWordin classTextInputControl
-
selectNextWord
public void selectNextWord()- Overrides:
selectNextWordin classTextInputControl
-
selectEndOfNextWord
public void selectEndOfNextWord()- Overrides:
selectEndOfNextWordin classTextInputControl
-
selectAll
public void selectAll()- Overrides:
selectAllin classTextInputControl
-
home
public void home()- Overrides:
homein classTextInputControl
-
end
public void end()- Overrides:
endin classTextInputControl
-
selectHome
public void selectHome()- Overrides:
selectHomein classTextInputControl
-
selectEnd
public void selectEnd()- Overrides:
selectEndin classTextInputControl
-
forward
public void forward()- Overrides:
forwardin classTextInputControl
-
backward
public void backward()- Overrides:
backwardin classTextInputControl
-
positionCaret
public void positionCaret(int pos) - Overrides:
positionCaretin classTextInputControl
-
selectPositionCaret
public void selectPositionCaret(int pos) - Overrides:
selectPositionCaretin classTextInputControl
-
selectRange
public void selectRange(int anchor, int caretPosition) - Overrides:
selectRangein classTextInputControl
-
extendSelection
public void extendSelection(int pos) - Overrides:
extendSelectionin classTextInputControl
-
clear
public void clear()- Overrides:
clearin classTextInputControl
-
deselect
public void deselect()- Overrides:
deselectin classTextInputControl
-
replaceSelection
- Overrides:
replaceSelectionin classTextInputControl
-
delegateGetTextFormatter
-
delegateTextFormatterProperty
Specifies theBoundTextFieldtext formatter. -
delegateSetTextFormatter
-
delegateGetAnchor
public int delegateGetAnchor() -
delegateAnchorProperty
Specifies theBoundTextFieldanchor position. -
delegateGetCaretPosition
public int delegateGetCaretPosition() -
delegateCaretPositionProperty
Specifies theBoundTextFieldcaret position. -
delegateGetSelectedText
-
delegateSelectedTextProperty
Specifies theBoundTextFieldselected text. -
delegateGetSelection
-
delegateSelectionProperty
Specifies theBoundTextFieldselection. -
delegateIsRedoable
public boolean delegateIsRedoable() -
delegateRedoableProperty
Delegates toBoundTextField, seeTextInputControl.redoableProperty(). -
delegateIsUndoable
public boolean delegateIsUndoable() -
delegateUndoableProperty
Delegates toBoundTextField, seeTextInputControl.undoableProperty(). -
delegateIsFocused
public boolean delegateIsFocused() -
delegateFocusedProperty
Specifies whether theBoundTextFieldis focused. -
getValidator
- Specified by:
getValidatorin interfaceValidated- Returns:
- the
MFXValidatorinstance of this control
-
isSelectable
public boolean isSelectable()Gets the value of the property selectable.- Property description:
- Specifies whether selection is allowed.
-
selectableProperty
Specifies whether selection is allowed.- See Also:
-
setSelectable
public void setSelectable(boolean selectable) Sets the value of the property selectable.- Property description:
- Specifies whether selection is allowed.
-
getLeadingIcon
Gets the value of the property leadingIcon.- Property description:
- Specifies the icon placed before the input field.
-
leadingIconProperty
Specifies the icon placed before the input field.- See Also:
-
setLeadingIcon
Sets the value of the property leadingIcon.- Property description:
- Specifies the icon placed before the input field.
-
getTrailingIcon
Gets the value of the property trailingIcon.- Property description:
- Specifies the icon placed after the input field.
-
trailingIconProperty
Specifies the icon placed after the input field.- See Also:
-
setTrailingIcon
Sets the value of the property trailingIcon.- Property description:
- Specifies the icon placed after the input field.
-
getFloatingText
Gets the value of the property floatingText.- Property description:
- Specifies the text of the floating text node.
-
floatingTextProperty
Specifies the text of the floating text node.- See Also:
-
setFloatingText
Sets the value of the property floatingText.- Property description:
- Specifies the text of the floating text node.
-
isFloating
public boolean isFloating()Gets the value of the property floating.- Property description:
- Specifies if the floating text node is currently floating or not.
-
floatingProperty
Specifies if the floating text node is currently floating or not.- See Also:
-
getMeasureUnit
Gets the value of the property measureUnit.- Property description:
- Specifies the unit of measure of the field. This is useful of course when dealing with numeric fields that represent for example: weight, volume, length and so on...
-
measureUnitProperty
Specifies the unit of measure of the field. This is useful of course when dealing with numeric fields that represent for example: weight, volume, length and so on...- See Also:
-
setMeasureUnit
Sets the value of the property measureUnit.- Property description:
- Specifies the unit of measure of the field. This is useful of course when dealing with numeric fields that represent for example: weight, volume, length and so on...
-
isAllowEdit
public boolean isAllowEdit()Gets the value of the property allowEdit.- Property description:
- Specifies whether the field is editable.
This property is bound bidirectionally to
TextInputControl.editableProperty(), it's here just to be set via CSS.
-
allowEditProperty
Specifies whether the field is editable.This property is bound bidirectionally to
TextInputControl.editableProperty(), it's here just to be set via CSS.- See Also:
-
setAllowEdit
public void setAllowEdit(boolean allowEdit) Sets the value of the property allowEdit.- Property description:
- Specifies whether the field is editable.
This property is bound bidirectionally to
TextInputControl.editableProperty(), it's here just to be set via CSS.
-
isAnimated
public boolean isAnimated()Gets the value of the property animated.- Property description:
- Specifies whether the floating text positioning is animated.
-
animatedProperty
Specifies whether the floating text positioning is animated.- See Also:
-
setAnimated
public void setAnimated(boolean animated) Sets the value of the property animated.- Property description:
- Specifies whether the floating text positioning is animated.
-
getBorderGap
public double getBorderGap()Gets the value of the property borderGap.- Property description:
- For
FloatMode.BORDERandFloatMode.ABOVEmodes, this specifies the distance from the control's x origin (padding not included).
-
borderGapProperty
ForFloatMode.BORDERandFloatMode.ABOVEmodes, this specifies the distance from the control's x origin (padding not included).- See Also:
-
setBorderGap
public void setBorderGap(double borderGap) Sets the value of the property borderGap.- Property description:
- For
FloatMode.BORDERandFloatMode.ABOVEmodes, this specifies the distance from the control's x origin (padding not included).
-
getCaretVisible
public boolean getCaretVisible()Gets the value of the property caretVisible.- Property description:
- Specifies whether the caret should be visible.
-
caretVisibleProperty
Specifies whether the caret should be visible.- See Also:
-
setCaretVisible
public void setCaretVisible(boolean caretVisible) Sets the value of the property caretVisible.- Property description:
- Specifies whether the caret should be visible.
-
getFloatMode
Gets the value of the property floatMode.- Property description:
- Specifies how the floating text is positioned when floating.
-
floatModeProperty
Specifies how the floating text is positioned when floating.- See Also:
-
setFloatMode
Sets the value of the property floatMode.- Property description:
- Specifies how the floating text is positioned when floating.
-
getFloatingTextGap
public double getFloatingTextGap()Gets the value of the property floatingTextGap.- Property description:
- For
FloatMode.INLINEmode, this specifies the gap between the floating text node and the input field node.
-
floatingTextGapProperty
ForFloatMode.INLINEmode, this specifies the gap between the floating text node and the input field node. -
setFloatingTextGap
public void setFloatingTextGap(double floatingTextGap) Sets the value of the property floatingTextGap.- Property description:
- For
FloatMode.INLINEmode, this specifies the gap between the floating text node and the input field node.
-
getGraphicTextGap
public double getGraphicTextGap()Gets the value of the property graphicTextGap.- Property description:
- Specifies the gap between the input field and the icons.
-
graphicTextGapProperty
Specifies the gap between the input field and the icons.- See Also:
-
setGraphicTextGap
public void setGraphicTextGap(double graphicTextGap) Sets the value of the property graphicTextGap.- Property description:
- Specifies the gap between the input field and the icons.
-
scaleOnAbove
public boolean scaleOnAbove() -
scaleOnAboveProperty
Specifies whether the floating text node should be scaled or not when the float mode is set toFloatMode.ABOVE.- See Also:
-
setScaleOnAbove
public void setScaleOnAbove(boolean scaleOnAbove) Sets the value of the property scaleOnAbove.- Property description:
- Specifies whether the floating text node should be scaled or not when
the float mode is set to
FloatMode.ABOVE.
-
getMeasureUnitGap
public double getMeasureUnitGap()Gets the value of the property measureUnitGap.- Property description:
- Specifies the gap between the field and the measure unit label.
-
measureUnitGapProperty
Specifies the gap between the field and the measure unit label.- See Also:
-
setMeasureUnitGap
public void setMeasureUnitGap(double measureUnitGap) Sets the value of the property measureUnitGap.- Property description:
- Specifies the gap between the field and the measure unit label.
-
getTextFill
Gets the value of the property textFill.- Property description:
- Specifies the text color.
-
textFillProperty
Specifies the text color.- See Also:
-
setTextFill
Sets the value of the property textFill.- Property description:
- Specifies the text color.
-
getTextLimit
public int getTextLimit()Gets the value of the property textLimit.- Property description:
- Specifies the maximum number of characters the field's text can have.
-
textLimitProperty
Specifies the maximum number of characters the field's text can have.- See Also:
-
setTextLimit
public void setTextLimit(int textLimit) Sets the value of the property textLimit.- Property description:
- Specifies the maximum number of characters the field's text can have.
-
getClassCssMetaData
-