/** Prepares the cell for editing */ @Override public void startEdit() { super.startEdit(); if (textField == null) { createTextField(); } setText(null); setGraphic(textField); textField.setText(getString()); textField.selectAll(); }
@Override public void startEdit() { super.startEdit(); if (textField == null) { createTextField(); } setGraphic(textField); setContentDisplay(ContentDisplay.GRAPHIC_ONLY); Platform.runLater( new Runnable() { @Override public void run() { textField.selectAll(); textField.requestFocus(); } }); }
private void updateEditing() { if (getIndex() == -1 || getTableView() == null) return; TablePosition editCell = getTableView().getEditingCell(); boolean match = match(editCell); if (match && !isEditing()) { startEdit(); } else if (!match && isEditing()) { // If my index is not the one being edited then I need to cancel // the edit. The tricky thing here is that as part of this call // I cannot end up calling list.edit(-1) the way that the standard // cancelEdit method would do. Yet, I need to call cancelEdit // so that subclasses which override cancelEdit can execute. So, // I have to use a kind of hacky flag workaround. updateEditingIndex = false; cancelEdit(); updateEditingIndex = true; } }
@Override public void startEdit() { if (!isEmpty()) { super.startEdit(); } }