T
- The type of the elements contained within the ListView.public class TextFieldListCell<T>
extends <any>
ListCell
implementation that draws a
TextField
node inside the cell.
By default, the TextFieldListCell is rendered as a Label
when not
being edited, and as a TextField when in editing mode. The TextField will, by
default, stretch to fill the entire list cell.
Type | Property and Description |
---|---|
<any> |
converter
The
StringConverter property. |
Modifier and Type | Field and Description |
---|---|
private <any> |
converter
*
Properties *
*
|
private TextField |
textField
*
Fields *
*
|
Constructor and Description |
---|
TextFieldListCell()
Creates a default TextFieldListCell with a null converter.
|
TextFieldListCell(<any> converter)
Creates a TextFieldListCell that provides a
TextField when put
into editing mode that allows editing of the cell content. |
Modifier and Type | Method and Description |
---|---|
void |
cancelEdit() |
<any> |
converterProperty()
The
StringConverter property. |
static <any> |
forListView()
Provides a
TextField that allows editing of the cell content when
the cell is double-clicked, or when ListView#edit(int) is called. |
static <T> <any> |
forListView(<any> converter)
Provides a
TextField that allows editing of the cell content when
the cell is double-clicked, or when ListView#edit(int) is called. |
<any> |
getConverter()
Returns the
StringConverter used in this cell. |
void |
setConverter(<any> value)
Sets the
StringConverter to be used in this cell. |
void |
startEdit() |
void |
updateItem(T item,
boolean empty) |
public final <any> converterProperty
StringConverter
property.StringConverter
propertyprivate TextField textField
private <any> converter
public TextFieldListCell()
StringConverter
specified, this cell will not be able to accept
input from the TextField (as it will not know how to convert this back
to the domain object). It is therefore strongly encouraged to not use
this constructor unless you intend to set the converter separately.public TextFieldListCell(<any> converter)
TextField
when put
into editing mode that allows editing of the cell content. This method
will work on any ListView instance, regardless of its generic type.
However, to enable this, a StringConverter
must be provided that
will convert the given String (from what the user typed in) into an
instance of type T. This item will then be passed along to the
ListView#onEditCommitProperty()
callback.converter
- A converter
that can convert
the given String (from what the user typed in) into an instance of
type T.public static <any> forListView()
TextField
that allows editing of the cell content when
the cell is double-clicked, or when ListView#edit(int)
is called.
This method will only work on ListView
instances which are of
type String.Callback
that can be inserted into the
cell factory property
of a
ListView, that enables textual editing of the content.public static <T> <any> forListView(<any> converter)
TextField
that allows editing of the cell content when
the cell is double-clicked, or when ListView#edit(int)
is called.
This method will work on any ListView instance, regardless of its generic
type. However, to enable this, a StringConverter
must be provided
that will convert the given String (from what the user typed in) into an
instance of type T. This item will then be passed along to the
ListView#onEditCommitProperty()
callback.T
- The type of the item contained within the Cellconverter
- A StringConverter
that can convert the given String
(from what the user typed in) into an instance of type T.Callback
that can be inserted into the
cell factory property
of a
ListView, that enables textual editing of the content.public final <any> converterProperty()
StringConverter
property.StringConverter
propertypublic final void setConverter(<any> value)
StringConverter
to be used in this cell.value
- the StringConverter
to be used in this cellpublic final <any> getConverter()
StringConverter
used in this cell.StringConverter
used in this cellpublic void startEdit()
public void cancelEdit()
public void updateItem(T item, boolean empty)