S
- The type of the TableView generic typeT
- The type of the elements contained within the TableColumn.public class TextFieldTableCell<S,T>
extends <any>
TableCell
implementation that draws a
TextField
node inside the cell.
By default, the TextFieldTableCell 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 table 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 |
---|
TextFieldTableCell()
Creates a default TextFieldTableCell with a null converter.
|
TextFieldTableCell(<any> converter)
Creates a TextFieldTableCell 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 <S> <any> |
forTableColumn()
Provides a
TextField that allows editing of the cell content when
the cell is double-clicked, or when
TableView#edit(int, javafx.scene.control.TableColumn) is called. |
static <S,T> <any> |
forTableColumn(<any> converter)
Provides a
TextField that allows editing of the cell content when
the cell is double-clicked, or when
TableView#edit(int, javafx.scene.control.TableColumn) 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 TextFieldTableCell()
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 TextFieldTableCell(<any> converter)
TextField
when put
into editing mode that allows editing of the cell content. This method
will work on any TableColumn 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
TableColumn#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 <S> <any> forTableColumn()
TextField
that allows editing of the cell content when
the cell is double-clicked, or when
TableView#edit(int, javafx.scene.control.TableColumn)
is called.
This method will only work on TableColumn
instances which are of
type String.S
- The type of the TableView generic typeCallback
that can be inserted into the
cell factory property
of a
TableColumn, that enables textual editing of the content.public static <S,T> <any> forTableColumn(<any> converter)
TextField
that allows editing of the cell content when
the cell is double-clicked, or when
TableView#edit(int, javafx.scene.control.TableColumn)
is called.
This method will work on any TableColumn
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
TableColumn#onEditCommitProperty()
callback.S
- The type of the TableView generic typeT
- The type of the elements contained within the TableColumnconverter
- 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
TableColumn, 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)