T
- The type of the elements contained within the TreeView.public class TextFieldTreeCell<T> extends DefaultTreeCell<T>
TreeCell
implementation that draws a
TextField
node inside the cell.
By default, the TextFieldTreeCell 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 tree cell.
Type | Property and Description |
---|---|
<any> |
converter
The
StringConverter property. |
Modifier and Type | Field and Description |
---|---|
private <any> |
converter
*
Properties *
*
|
private HBox |
hbox |
private TextField |
textField
*
Fields *
*
|
Constructor and Description |
---|
TextFieldTreeCell()
Creates a default TextFieldTreeCell with a null converter.
|
TextFieldTreeCell(<any> converter)
Creates a TextFieldTreeCell 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> |
forTreeView()
Provides a
TextField that allows editing of the cell content when
the cell is double-clicked, or when
TreeView#edit(javafx.scene.control.TreeItem) is called. |
static <T> <any> |
forTreeView(<any> converter)
Provides a
TextField that allows editing of the cell content when
the cell is double-clicked, or when
TreeView#edit(javafx.scene.control.TreeItem) is called. |
<any> |
getConverter()
Returns the
StringConverter used in this cell. |
private Node |
getTreeItemGraphic()
*
Private Implementation *
*
|
void |
setConverter(<any> value)
Sets the
StringConverter to be used in this cell. |
void |
startEdit() |
void |
updateItem(T item,
boolean empty) |
updateDisplay
public final <any> converterProperty
StringConverter
property.StringConverter
propertyprivate TextField textField
private HBox hbox
private <any> converter
public TextFieldTreeCell()
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 TextFieldTreeCell(<any> converter)
TextField
when put
into editing mode that allows editing of the cell content. This method
will work on any TreeView 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
TreeView#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> forTreeView()
TextField
that allows editing of the cell content when
the cell is double-clicked, or when
TreeView#edit(javafx.scene.control.TreeItem)
is called.
This method will only work on TreeView
instances which are of
type String.Callback
that can be inserted into the
cell factory property
of a
TreeView, that enables textual editing of the content.public static <T> <any> forTreeView(<any> converter)
TextField
that allows editing of the cell content when
the cell is double-clicked, or when
TreeView#edit(javafx.scene.control.TreeItem)
is called. This
method will work on any TreeView
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 TreeView#onEditCommitProperty()
callback.T
- The type of the elements contained within the TreeViewconverter
- 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
TreeView, 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)
updateItem
in class DefaultTreeCell<T>
private Node getTreeItemGraphic()