Skip to content
Snippets Groups Projects
Commit 31b575ef authored by Andreas Bayha's avatar Andreas Bayha
Browse files

Kernel: Fixed column number issue in DynamicTreeTableUIProviderBase

DynamicTreeTableUIProviderBase did not take into account hidden
(invisible) columns for numbering. With this, column numbers changed,
whenever a column became invisible.

Now the column number is correct - also invisible columns are counted.

Issue-Ref: 4014
Issue-Url: https://af3-developer.fortiss.org/issues/4014


Signed-off-by: default avatarAndreas Bayha <bayha@fortiss.org>
parent 133a7b22
No related branches found
No related tags found
1 merge request!1254014
......@@ -5,7 +5,7 @@ DynamicTextFieldTreeTableCell.java de24117e6f785b328f1ff62383626a0b4b54e8ff GREE
DynamicTreeContentProviderBase.java 91896b1fb5104d126544c44c1ff8c30f2a13a8d6 GREEN
DynamicTreeItem.java 7486071d20e896d6ca9a9101bf105caccf3656d0 GREEN
DynamicTreeItemBase.java d883066ecc181120302ca32f328538de7a45b093 GREEN
DynamicTreeTableUIProviderBase.java b326c4b666e54285ebbb67570da05d002d52fb3c GREEN
DynamicTreeTableUIProviderBase.java a4cd60795d114984f7fd255f273fc39937889f22 YELLOW
DynamicTreeTableViewer.java ead6f6671e9cb6b14632940bf440cba7e81fcd98 GREEN
DynamicTreeUIProviderBase.java 82d3c051213f0147f4c67ad247a08696cee73110 GREEN
DynamicTreeViewer.java e58d2cf7239e45f1b790ce9770a8a8649b1b5fb9 GREEN
......
......@@ -85,7 +85,8 @@ public abstract class DynamicTreeTableUIProviderBase<T> {
}
/**
* Determines the background color for a given element in the specified column.
* Determines the background color for a given element in the specified column.
*
* @param element
* The element to specify the background color for.
* @param column
......@@ -196,7 +197,12 @@ public abstract class DynamicTreeTableUIProviderBase<T> {
});
column.setOnEditCommit(event -> {
T element = event.getRowValue().getValue();
int colIndex = event.getTreeTablePosition().getColumn();
// The column number needs to be retrieved from the viewer, as the the
// event.getTablePosition() does not take into account invisible columns for numbering.
TreeTableColumn<T, String> tableColumn = event.getTableColumn();
int colIndex = tableColumn.getTreeTableView().getColumns().indexOf(tableColumn);
String value = event.getNewValue();
updateValue(element, colIndex, value);
column.getTreeTableView().refresh();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment