Interface TextFieldBuilder<T,​C extends JTextField,​B extends TextFieldBuilder<T,​C,​B>>

    • Field Detail

      • DEFAULT_TEXT_FIELD_COLUMNS

        static final PropertyValue<Integer> DEFAULT_TEXT_FIELD_COLUMNS
        Specifies the default number of columns in text fields created by component builders
        Value type: Integer
        Default value: 12
    • Method Detail

      • columns

        B columns​(int columns)
        Parameters:
        columns - the number of colums in the text component
        Returns:
        this builder instance
        See Also:
        JTextField.setColumns(int)
      • selectAllOnFocusGained

        B selectAllOnFocusGained​(boolean selectAllOnFocusGained)
        Makes the text field select all when it gains focus
        Parameters:
        selectAllOnFocusGained - if true the component will select contents on focus gained
        Returns:
        this builder instance
      • selectionProvider

        B selectionProvider​(SelectionProvider<T> selectionProvider)
        Adds a CTRL-SPACE action the given text field allowing the user to select a value to display in the field
        Parameters:
        selectionProvider - the selection provider
        Returns:
        this builder instance
      • format

        B format​(Format format)
        Associates the given format with the text field. Note that the format instance is cloned on build, so format instances can be reused when calling this method.
        Parameters:
        format - the format
        Returns:
        this builder instance
      • horizontalAlignment

        B horizontalAlignment​(int horizontalAlignment)
        Parameters:
        horizontalAlignment - the horizontal text alignment
        Returns:
        this builder instance
        See Also:
        JTextField.setHorizontalAlignment(int)
      • hintText

        B hintText​(String hintText)
        Parameters:
        hintText - the hint text to display when the field is empty and unfocused
        Returns:
        this builder instance
      • builder

        static <T,​C extends JTextField,​B extends TextFieldBuilder<T,​C,​B>> TextFieldBuilder<T,​C,​B> builder​(Class<T> valueClass)
        Type Parameters:
        T - the value type
        C - the text field type
        B - the builder type
        Parameters:
        valueClass - the value class
        Returns:
        a builder for a component
      • builder

        static <T,​C extends JTextField,​B extends TextFieldBuilder<T,​C,​B>> TextFieldBuilder<T,​C,​B> builder​(Class<T> valueClass,
                                                                                                                                              Value<T> linkedValue)
        Type Parameters:
        T - the value type
        C - the text field type
        B - the builder type
        Parameters:
        valueClass - the value class
        linkedValue - the value to link to the component
        Returns:
        a builder for a component