Class FxTextComponentDelegate

    • Constructor Detail

      • FxTextComponentDelegate

        public FxTextComponentDelegate()
    • Method Detail

      • getTextComponent

        protected FxTextComponent getTextComponent()
        Gets the text component.
        Returns:
        the text component
      • updateChangeable

        protected void updateChangeable​(boolean changeable)
        Description copied from class: FxControlDelegate
        Updates other properties if changeable is bound to something else.
        Overrides:
        updateChangeable in class FxComponentDelegate
        Parameters:
        changeable - the flag
      • updateMandatoryStyle

        protected void updateMandatoryStyle​(boolean mandatory)
        Description copied from class: FxComponentDelegate
        Does the physical update of the style. See resources/org/tentackle/fx/tentackle.css
        Overrides:
        updateMandatoryStyle in class FxComponentDelegate
        Parameters:
        mandatory - true if mandatory
      • createChangeableProperty

        protected javafx.beans.property.ReadOnlyBooleanWrapper createChangeableProperty​(boolean changeable)
        Description copied from class: FxControlDelegate
        Creates the changeable property.
        Overrides:
        createChangeableProperty in class FxComponentDelegate
        Parameters:
        changeable - the initial value
        Returns:
        the property
      • setContainerChangeable

        public void setContainerChangeable​(boolean containerChangeable)
        Description copied from interface: FxControl
        Invoked when setChangeable() is invoked on the container of this component.
        Specified by:
        setContainerChangeable in interface FxControl
        Overrides:
        setContainerChangeable in class FxComponentDelegate
        Parameters:
        containerChangeable - true if container is changeable, false if all components readonly
      • getErrorOffset

        public java.lang.Integer getErrorOffset()
        Description copied from interface: FxTextComponent
        Gets the error offset.
        Specified by:
        getErrorOffset in interface FxTextComponent
        Returns:
        the offset, null if no offset
      • setErrorOffset

        public void setErrorOffset​(java.lang.Integer errorOffset)
        Description copied from interface: FxTextComponent
        Sets the error offset.
        Specified by:
        setErrorOffset in interface FxTextComponent
        Parameters:
        errorOffset - null to clear
      • setError

        public void setError​(java.lang.String errorMessage)
        Description copied from interface: ErrorPopupSupported
        Sets the error message.
        Notice that an empty string will set the style but dows not show any popup.
        Specified by:
        setError in interface ErrorPopupSupported
        Overrides:
        setError in class FxComponentDelegate
        Parameters:
        errorMessage - the error message, null to clear
      • setValidChars

        public void setValidChars​(java.lang.String validChars)
        Description copied from interface: FxTextComponent
        Sets allowed characters.
        Specified by:
        setValidChars in interface FxTextComponent
        Parameters:
        validChars - the valid characters, null = all (default)
      • getValidChars

        public java.lang.String getValidChars()
        Description copied from interface: FxTextComponent
        Gets allowed characters.
        Specified by:
        getValidChars in interface FxTextComponent
        Returns:
        the valid characters, null = all (default)
      • setInvalidChars

        public void setInvalidChars​(java.lang.String invalidChars)
        Description copied from interface: FxTextComponent
        Sets invalid characters.
        Specified by:
        setInvalidChars in interface FxTextComponent
        Parameters:
        invalidChars - the invalid characters, null = none (default)
      • getInvalidChars

        public java.lang.String getInvalidChars()
        Description copied from interface: FxTextComponent
        Gets invalid characters.
        Specified by:
        getInvalidChars in interface FxTextComponent
        Returns:
        the invalid characters, null = none (default)
      • setTextConverter

        public void setTextConverter​(java.util.function.Function<java.lang.String,​java.lang.String> textConverter)
        Description copied from interface: FxTextComponent
        Sets a text converter.
        Converts input text to the view's text.
        Specified by:
        setTextConverter in interface FxTextComponent
        Parameters:
        textConverter - the converter
      • getTextConverter

        public java.util.function.Function<java.lang.String,​java.lang.String> getTextConverter()
        Description copied from interface: FxTextComponent
        Gets the text converter.
        Specified by:
        getTextConverter in interface FxTextComponent
        Returns:
        the converter
      • apply

        public javafx.scene.control.TextFormatter.Change apply​(javafx.scene.control.TextFormatter.Change t)
        Specified by:
        apply in interface java.util.function.Function<javafx.scene.control.TextFormatter.Change,​javafx.scene.control.TextFormatter.Change>
      • filter

        public java.lang.String filter​(java.lang.String text)
        Filters input characters.
        Parameters:
        text - the input text, never null
        Returns:
        the filtered text, never null
      • setTextAlignment

        public void setTextAlignment​(javafx.geometry.Pos textAlignment)
        Description copied from interface: FxTextComponent
        Sets the text alignment.
        Specified by:
        setTextAlignment in interface FxTextComponent
        Parameters:
        textAlignment - the alignment, null if component's default
      • getTextAlignment

        public javafx.geometry.Pos getTextAlignment()
        Description copied from interface: FxTextComponent
        Gets the text alignment.
        Specified by:
        getTextAlignment in interface FxTextComponent
        Returns:
        the alignment, null if component's default
      • setType

        public void setType​(java.lang.Class<?> type)
        Description copied from interface: FxComponent
        Sets the type for this component.

        Notice that the type can be applied only once. This is because previously installed listeners could cause memleaks.

        Specified by:
        setType in interface FxComponent
        Overrides:
        setType in class FxComponentDelegate
        Parameters:
        type - the type
      • createValueTranslator

        protected ValueTranslator<?,​?> createValueTranslator​(java.lang.Class<?> type)
      • setMaxColumns

        public void setMaxColumns​(int maxColumns)
        Description copied from interface: FxTextComponent
        Sets the maximum number of columns.
        The number of columns will be enforced by the model.
        Specified by:
        setMaxColumns in interface FxTextComponent
        Parameters:
        maxColumns - the maximum number of columns, 0 if unlimited (default)
      • getMaxColumns

        public int getMaxColumns()
        Description copied from interface: FxTextComponent
        Gets the maximum number of columns.
        Specified by:
        getMaxColumns in interface FxTextComponent
        Returns:
        the maximum number of columns, 0 if unlimited (default)
      • setAutoSelect

        public void setAutoSelect​(boolean autoSelect)
        Description copied from interface: FxTextComponent
        Sets the auto-select feature.
        A component with autoselect enabled will automatically select all characters if the component gets the keyboard focus. Useful for numerical fields, for example.
        Specified by:
        setAutoSelect in interface FxTextComponent
        Parameters:
        autoSelect - true if autoselect enabled, false if disabled (default)
      • isAutoSelect

        public boolean isAutoSelect()
        Description copied from interface: FxTextComponent
        Returns whether the auto-select feature is enabled.
        Specified by:
        isAutoSelect in interface FxTextComponent
        Returns:
        true if autoselect enabled, false if disabled (default)
      • setPattern

        public void setPattern​(java.lang.String pattern)
        Description copied from interface: FxTextComponent
        Sets the format pattern.
        The format pattern is used to format the view of the data.
        Specified by:
        setPattern in interface FxTextComponent
        Parameters:
        pattern - the format pattern
      • getPattern

        public java.lang.String getPattern()
        Description copied from interface: FxTextComponent
        Gets the format pattern.
        Specified by:
        getPattern in interface FxTextComponent
        Returns:
        the format pattern
      • isLenient

        public boolean isLenient()
        Description copied from interface: FxTextComponent
        Returns whether parsing to model should be lenient.
        Specified by:
        isLenient in interface FxTextComponent
        Returns:
        true if lenient, false is default
      • setLenient

        public void setLenient​(boolean lenient)
        Description copied from interface: FxTextComponent
        Sets whether parsing to model should be lenient.
        Specified by:
        setLenient in interface FxTextComponent
        Parameters:
        lenient - true if lenient
      • setScale

        public void setScale​(int scale)
        Description copied from interface: FxTextComponent
        Changes the format according to the given scale.
        Specified by:
        setScale in interface FxTextComponent
        Parameters:
        scale - the number of digits after the comma
      • isUnsigned

        public boolean isUnsigned()
        Description copied from interface: FxTextComponent
        Returns whether a numeric field is unsigned or signed.
        Specified by:
        isUnsigned in interface FxTextComponent
        Returns:
        true if unsigned
      • setUnsigned

        public void setUnsigned​(boolean unsigned)
        Description copied from interface: FxTextComponent
        Sets whether a numeric field is unsigned or signed.
        Specified by:
        setUnsigned in interface FxTextComponent
        Parameters:
        unsigned - true if unsigned
      • isUTC

        public boolean isUTC()
        Description copied from interface: FxTextComponent
        Returns whether this is a UTC timestamp.
        Specified by:
        isUTC in interface FxTextComponent
        Returns:
        true if UTC
      • setUTC

        public void setUTC​(boolean utc)
        Description copied from interface: FxTextComponent
        Sets whether this is a UTC timestamp.
        Specified by:
        setUTC in interface FxTextComponent
        Parameters:
        utc - true if UTC
      • setFiller

        public void setFiller​(char filler)
        Description copied from interface: FxTextComponent
        Sets the filler character.
        The default is space.
        Specified by:
        setFiller in interface FxTextComponent
        Parameters:
        filler - the filler