Class StyledTextField<PS,​S>

    • Property Detail

      • alignment

        public final javafx.beans.property.ObjectProperty<javafx.scene.text.TextAlignment> alignmentProperty
        Specifies how the text should be aligned when there is empty space within the TextField. To configure via CSS use -fx-alignment: and values from TextAlignment.
        See Also:
        getAlignment(), setAlignment(TextAlignment)
      • onAction

        public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<javafx.event.ActionEvent>> onActionProperty
        The action handler associated with this text field, or null if no action handler is assigned. The action handler is normally called when the user types the ENTER key.
        See Also:
        getOnAction(), setOnAction(EventHandler)
    • Constructor Detail

      • StyledTextField

        public StyledTextField​(PS initialParagraphStyle,
                               java.util.function.BiConsumer<javafx.scene.text.TextFlow,​PS> applyParagraphStyle,
                               S initialTextStyle,
                               java.util.function.BiConsumer<? super TextExt,​S> applyStyle,
                               EditableStyledDocument<PS,​java.lang.String,​S> document)
    • Method Detail

      • alignmentProperty

        public final javafx.beans.property.ObjectProperty<javafx.scene.text.TextAlignment> alignmentProperty()
        Specifies how the text should be aligned when there is empty space within the TextField. To configure via CSS use -fx-alignment: and values from TextAlignment.
        See Also:
        getAlignment(), setAlignment(TextAlignment)
      • getAlignment

        public final javafx.scene.text.TextAlignment getAlignment()
        Gets the value of the property alignment.
        Property description:
        Specifies how the text should be aligned when there is empty space within the TextField. To configure via CSS use -fx-alignment: and values from TextAlignment.
      • setAlignment

        public final void setAlignment​(javafx.scene.text.TextAlignment value)
        Sets the value of the property alignment.
        Property description:
        Specifies how the text should be aligned when there is empty space within the TextField. To configure via CSS use -fx-alignment: and values from TextAlignment.
      • changeAlignment

        protected abstract void changeAlignment​(javafx.scene.text.TextAlignment txtAlign)
      • onActionProperty

        public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<javafx.event.ActionEvent>> onActionProperty()
        The action handler associated with this text field, or null if no action handler is assigned. The action handler is normally called when the user types the ENTER key.
        See Also:
        getOnAction(), setOnAction(EventHandler)
      • getOnAction

        public final javafx.event.EventHandler<javafx.event.ActionEvent> getOnAction()
        Gets the value of the property onAction.
        Property description:
        The action handler associated with this text field, or null if no action handler is assigned. The action handler is normally called when the user types the ENTER key.
      • setOnAction

        public final void setOnAction​(javafx.event.EventHandler<javafx.event.ActionEvent> value)
        Sets the value of the property onAction.
        Property description:
        The action handler associated with this text field, or null if no action handler is assigned. The action handler is normally called when the user types the ENTER key.
      • setPromptText

        public final void setPromptText​(javafx.scene.text.Text value)
        The prompt text to display or null if no prompt text is to be displayed.

        The Text will be aligned according to the text fields alignment setting and have a default text fill of GRAY unless you have changed it by any means, e.g. with CSS "-fx-prompt-text-fill"

      • promptTextProperty

        public final javafx.beans.property.ObjectProperty<? super javafx.scene.text.Text> promptTextProperty()
        See Also:
        getPromptText(), setPromptText(Text)
      • getPromptText

        public final javafx.scene.text.Text getPromptText()
        Gets the value of the property promptText.
        Property description:
      • setPlaceholder

        public void setPlaceholder​(javafx.scene.Node value,
                                   javafx.geometry.Pos where)
        setPlaceholder is not supported by StyledTextField, use setPromptText instead
        Overrides:
        setPlaceholder in class GenericStyledArea<PS,​java.lang.String,​S>
      • configurePlaceholder

        protected void configurePlaceholder​(javafx.scene.Node placeholder)
        Description copied from class: GenericStyledArea
        Override this to customize the placeholder's layout.
        The default position is centered over the area.
        Overrides:
        configurePlaceholder in class GenericStyledArea<PS,​java.lang.String,​S>
      • replaceText

        public void replaceText​(int start,
                                int end,
                                java.lang.String text)
        Description copied from interface: TextEditingArea
        Replaces a range of characters with the given text. It must hold 0 <= start <= end <= getLength().
        Specified by:
        replaceText in interface TextEditingArea<PS,​java.lang.String,​S>
        Overrides:
        replaceText in class GenericStyledArea<PS,​java.lang.String,​S>
        Parameters:
        start - Start index of the range to replace, inclusive.
        end - End index of the range to replace, exclusive.
        text - The text to put in place of the deleted range. It must not be null.
      • setText

        public void setText​(java.lang.String text)
      • setWrapText

        @Deprecated
        public void setWrapText​(boolean value)
        Deprecated.
        This is a no op for text fields and therefore marked as deprecated.
        Specified by:
        setWrapText in interface ViewActions<PS,​java.lang.String,​S>
        Overrides:
        setWrapText in class GenericStyledArea<PS,​java.lang.String,​S>
      • getCssMetaData

        public java.util.List<javafx.css.CssMetaData<? extends javafx.css.Styleable,​?>> getCssMetaData()
        Specified by:
        getCssMetaData in interface javafx.css.Styleable
        Overrides:
        getCssMetaData in class GenericStyledArea<PS,​java.lang.String,​S>
      • getClassCssMetaData

        public static java.util.List<javafx.css.CssMetaData<? extends javafx.css.Styleable,​?>> getClassCssMetaData()