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

Kernel: Cells in TreeTable rows without item cannot be edited by default


For rows with empty item (such as headlines) the editability of the
whole column was used so far.
Now such cells can only be edited if they at least contain an empty
String.

Issue-Ref: 4133
Issue-Url: #4133

Signed-off-by: default avatarAndreas Bayha <bayha@fortiss.org>
parent cf9a3d6d
No related branches found
No related tags found
1 merge request!141Tooling Kernel: Fixed editing issue in DynamicTreeTable
Pipeline #30976 failed
......@@ -5,7 +5,7 @@ DynamicTextFieldTreeTableCell.java de24117e6f785b328f1ff62383626a0b4b54e8ff GREE
DynamicTreeContentProviderBase.java 91896b1fb5104d126544c44c1ff8c30f2a13a8d6 GREEN
DynamicTreeItem.java 7486071d20e896d6ca9a9101bf105caccf3656d0 GREEN
DynamicTreeItemBase.java d883066ecc181120302ca32f328538de7a45b093 GREEN
DynamicTreeTableUIProviderBase.java 7c534d8567fb88159977765cb7b6f60c21f1ab48 YELLOW
DynamicTreeTableUIProviderBase.java 5bc7f6a74e379baa525f5d3420a95e558cbcbe90 YELLOW
DynamicTreeTableViewer.java ead6f6671e9cb6b14632940bf440cba7e81fcd98 GREEN
DynamicTreeUIProviderBase.java 82d3c051213f0147f4c67ad247a08696cee73110 GREEN
DynamicTreeViewer.java 545f1ca10b7b3cad171b294a4b447875da45c9ed GREEN
......
......@@ -48,6 +48,11 @@ import javafx.util.converter.DefaultStringConverter;
*/
public abstract class DynamicTreeTableUIProviderBase<T> {
/**
* Retrieves the label to be displayed in the given position.
*
* Note: An empty cell can only be editable, if an empty String is returned here instead of
* 'null'.
*
* @param element
* the element to be displayed in the current row
* @param column
......@@ -347,9 +352,20 @@ public abstract class DynamicTreeTableUIProviderBase<T> {
@Override
public void updateItem(String item, boolean empty) {
super.updateItem(item, empty);
styleCell(this, columnIndex);
}
/** {@inheritDoc} */
@Override
public void startEdit() {
// null items are in cells, which cannot contain a value. Otherwise they
// would contain an empty String.
if(getItem() == null) {
return;
}
setEditable(item != null);
super.startEdit();
}
};
......@@ -380,7 +396,7 @@ public abstract class DynamicTreeTableUIProviderBase<T> {
/** {@inheritDoc} */
@Override
public void startEdit() {
if(!isEditable() || !getTreeTableView().isEditable() ||
if(getItem() == null || !isEditable() || !getTreeTableView().isEditable() ||
!getTableColumn().isEditable()) {
return;
}
......
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