Top Description Fields Constructors Methods
org.controlsfx.control.textfield

public Class TextFields

extends Object
Class Inheritance
Imports
impl.org.controlsfx.autocompletion.AutoCompletionTextFieldBinding, .SuggestionProvider, java.util.Arrays, .Collection, javafx.animation.FadeTransition, javafx.beans.InvalidationListener, .Observable, javafx.beans.property.ObjectProperty, javafx.scene.Cursor, .Node, javafx.scene.control.PasswordField, .TextField, javafx.scene.layout.Region, .StackPane, javafx.util.Callback, .Duration, .StringConverter, org.controlsfx.control.textfield.AutoCompletionBinding.ISuggestionRequest

A class containing useful customizations for the JavaFX TextField. Note that this class is experimental and the API may change in future releases. Note also that this class makes use of the CustomTextField class.
See Also
CustomTextField

Field Summary

Modifier and TypeField and Description
private static final Duration

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static <T> AutoCompletionBinding<T>
bindAutoCompletion(TextField
The TextField to which auto-completion shall be added
textField
,
Callback<AutoCompletionBinding.ISuggestionRequest, Collection<T>>
A suggestion-provider strategy to use
suggestionProvider
,
StringConverter<T>
The converter to be used to convert suggestions to strings
converter
)

Create a new auto-completion binding between the given textField and the given suggestion provider.

public static <T> AutoCompletionBinding<T>

Returns:

The AutoCompletionBinding
bindAutoCompletion
(TextField
The TextField to which auto-completion shall be added
textField
,
Callback<AutoCompletionBinding.ISuggestionRequest, Collection<T>>
A suggestion-provider strategy to use
suggestionProvider
)

Create a new auto-completion binding between the given textField and the given suggestion provider.

public static <T> AutoCompletionBinding<T>

Returns:

The AutoCompletionBinding
bindAutoCompletion
(TextField
The TextField to which auto-completion shall be added
textField
,
T...
Possible auto-complete suggestions
possibleSuggestions
)

Create a new auto-completion binding between the given TextField using the given auto-complete suggestions

public static <T> AutoCompletionBinding<T>
bindAutoCompletion(TextField textField, Collection<T> possibleSuggestions)

public static PasswordField
createClearablePasswordField()

Creates a PasswordField that shows a clear button inside the PasswordField (on the right hand side of it) when text is entered by the user.

public static TextField
createClearableTextField()

Creates a TextField that shows a clear button inside the TextField (on the right hand side of it) when text is entered by the user.

private static void
setupClearButtonField(TextField inputField, ObjectProperty<Node> rightProperty)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

FADE_DURATIONback to summary
private static final Duration FADE_DURATION

Constructor Detail

TextFieldsback to summary
private TextFields()

Method Detail

bindAutoCompletionback to summary
public static <T> AutoCompletionBinding<T> bindAutoCompletion(TextField textField, Callback<AutoCompletionBinding.ISuggestionRequest, Collection<T>> suggestionProvider, StringConverter<T> converter)

Create a new auto-completion binding between the given textField and the given suggestion provider. The TextFields API has some suggestion-provider builder methods for simple use cases.

Parameters
textField:TextField

The TextField to which auto-completion shall be added

suggestionProvider:Callback<AutoCompletionBinding.ISuggestionRequest, Collection<T>>

A suggestion-provider strategy to use

converter:StringConverter<T>

The converter to be used to convert suggestions to strings

bindAutoCompletionback to summary
public static <T> AutoCompletionBinding<T> bindAutoCompletion(TextField textField, Callback<AutoCompletionBinding.ISuggestionRequest, Collection<T>> suggestionProvider)

Create a new auto-completion binding between the given textField and the given suggestion provider. The TextFields API has some suggestion-provider builder methods for simple use cases.

Parameters
textField:TextField

The TextField to which auto-completion shall be added

suggestionProvider:Callback<AutoCompletionBinding.ISuggestionRequest, Collection<T>>

A suggestion-provider strategy to use

Returns:AutoCompletionBinding<T>

The AutoCompletionBinding

bindAutoCompletionback to summary
public static <T> AutoCompletionBinding<T> bindAutoCompletion(TextField textField, T... possibleSuggestions)

Create a new auto-completion binding between the given TextField using the given auto-complete suggestions

Parameters
textField:TextField

The TextField to which auto-completion shall be added

possibleSuggestions:T[]

Possible auto-complete suggestions

Returns:AutoCompletionBinding<T>

The AutoCompletionBinding

bindAutoCompletionback to summary
public static <T> AutoCompletionBinding<T> bindAutoCompletion(TextField textField, Collection<T> possibleSuggestions)
createClearablePasswordFieldback to summary
public static PasswordField createClearablePasswordField()

Creates a PasswordField that shows a clear button inside the PasswordField (on the right hand side of it) when text is entered by the user.

createClearableTextFieldback to summary
public static TextField createClearableTextField()

Creates a TextField that shows a clear button inside the TextField (on the right hand side of it) when text is entered by the user.

setupClearButtonFieldback to summary
private static void setupClearButtonField(TextField inputField, ObjectProperty<Node> rightProperty)