How can I programmatically make a specific cell enter the startEdit state?

48 Views Asked by At

I have set up a cellFactory for the fourth column of the table and the key code for the TableCell is as follows:

@Override
public void startEdit() {
    super.startEdit();
    comboBox.setValue(getString());
    setGraphic(comboBox);
    comboBox.setPrefWidth(getTableColumn().getMinWidth());
}

@Override
public void cancelEdit() {
    super.cancelEdit();
    setGraphic(null);
    setText(getString());
}

private String getString() {
    return (getItem() == null) ? ""
                   : (Objects.equals(getItem(), EegLeadType.NONE_FOCUS_NAME) ? EegLeadType.NONE_NAME
                             : getItem());
}

How can I programmatically make a specific cell enter the startEdit state? For example, if I have selected a row in the table, I want the cell in the fourth column of that row to enter the startEdit state, without having to click on the fourth column.

enter image description here

0

There are 0 best solutions below