Skip to content
Snippets Groups Projects
Commit 1e40ef29 authored by Johannes Eder's avatar Johannes Eder
Browse files

YELLOW

parent c67e047f
No related branches found
No related tags found
1 merge request!118[4029] Impl of generic Checkbox column for TableTreeViewers
DynamicTreeContentProviderBase.java 6760a6dc5721175b1dada8f30fd9da05f7bcc4b3 GREEN
DynamicTreeItem.java 75dc5534b119ffdb3c10a65810c2a0f330b7955e GREEN
DynamicTreeTableUIProviderBase.java b9e68bede4ad0763e4ea3d3c1e7edeb0d63ed261 RED
DynamicTreeTableUIProviderBase.java 4adb4066bdd8eac75f7b8a4ba7aa5d42b43d8e32 YELLOW
DynamicTreeTableViewer.java 5e58a31a63f8e56d8c8e69e2c4d095809bc46bf1 GREEN
DynamicTreeUIProviderBase.java e9b68607683de279d0cb8712a28dc131c5c33ece GREEN
DynamicTreeViewer.java 725f41f4fb4b6bfa813f010fb9083ab02eea164a GREEN
......
......@@ -156,22 +156,12 @@ public abstract class DynamicTreeTableUIProviderBase<T> {
/** Applies a checkbox editing support to the given checkbox column. */
/* package */ final void applyToCheckboxColumn(int i, TreeTableColumn<T, Boolean> column) {
// TODO (SB): Maybe the following would be safer?
// column.setOnEditCommit(null);
// column.setEditable(isEditable(i));
// if(!isEditable(i)) {
// return;
// }
column.setOnEditCommit(null);
column.setEditable(isEditable(i));
if(!isEditable(i)) {
column.setEditable(false);
column.setOnEditCommit(null);
return;
}
column.setEditable(true);
// end of previous TODO
// TODO Could we save some memory here and use the same CallBack for all columns (i.e., make
// this a static field of DynamicTreeTableUIProviderBase)?
// setOnEditCommit() does not work for CheckBoxTreeTableCell. This is why a custom
// CellValueFactory has to be set here
column.setCellValueFactory(new Callback<TreeTableColumn.CellDataFeatures<T, Boolean>, //
......@@ -183,8 +173,14 @@ public abstract class DynamicTreeTableUIProviderBase<T> {
call(TreeTableColumn.CellDataFeatures<T, Boolean> param) {
TreeItem<T> treeItem = param.getValue();
T value = treeItem.getValue();
String label = getLabel(value, i);
// TODO (SB) Error handling for values != "true" or "false"
String label = getLabel(value, i).trim().toLowerCase();
// String to boolean transformations throw no error/exception that is why this has
// to be captured manually here.
if(!(label.equals("true") || label.equals("false"))) {
throw new RuntimeException(
"Wrong type in chebckobx table cell. Expected boolean \"true\" or \"false\" but received \"" +
label + "\".");
}
boolean b = Boolean.valueOf(label);
SimpleBooleanProperty booleanProp = new SimpleBooleanProperty(b);
......
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