Commit 16346628 authored by Florian Hölzl's avatar Florian Hölzl

Kernel: tree editors receive cancel event when escape was released.

Issue-Ref: 3961
Issue-Url: https://af3-developer.fortiss.org/issues/3961Signed-off-by: Florian Hölzl's avatarFlorian Hoelzl <hoelzl@fortiss.org>
parent 1ee8032a
DynamicTreeContentProviderBase.java 6760a6dc5721175b1dada8f30fd9da05f7bcc4b3 GREEN
DynamicTreeItem.java 75dc5534b119ffdb3c10a65810c2a0f330b7955e GREEN
DynamicTreeTableUIProviderBase.java 4fbc6171f3e95900678d7c2baea680e91fcc5be1 YELLOW
DynamicTreeTableUIProviderBase.java f4fd20e3d267bc39a33a3bbb18416312779ea886 YELLOW
DynamicTreeTableViewer.java 431ac62cbd6ad7df25852fce1b5a62a05ba510e3 GREEN
DynamicTreeUIProviderBase.java e9b68607683de279d0cb8712a28dc131c5c33ece GREEN
DynamicTreeViewer.java e9f19d16a2a7e5a1b03b8a8b543453ac7eb6a051 GREEN
......
......@@ -167,10 +167,14 @@ public abstract class DynamicTreeTableUIProviderBase<T> {
/** {@inheritDoc} */
@Override
public void startEdit() {
if(!isEditable() || !getTreeTableView().isEditable() ||
!getTableColumn().isEditable()) {
return;
}
super.startEdit();
// the following code uses implementation details of
// CellUtils.startEdit(...) and CellUtils.createTextfield(...)
TextField tf = (TextField)getGraphic(); // CellUtil:228
TextField tf = (TextField)getGraphic(); // CellUtils:228
tf.setOnKeyReleased(t -> {
DynamicTreeTableUIProviderBase<T>.MyTextFieldTreeTableCell mythis =
MyTextFieldTreeTableCell.this;
......@@ -183,6 +187,26 @@ public abstract class DynamicTreeTableUIProviderBase<T> {
}
});
}
/** {@inheritDoc} */
@Override
public void cancelEdit() {
super.cancelEdit();
T item = getTreeTableRow().getItem();
validateOnCancelEdit(columnIndex, item);
}
}
/**
* Called when editing a cell was canceled.
*
* @param colIndex
* the index of the column
* @param item
* the row item
*/
public void validateOnCancelEdit(int colIndex, T item) {
// nothing to do
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment