diff --git a/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/control/treetableview/.ratings b/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/control/treetableview/.ratings index d113be5ff8472f3f50f3b5d78ca912a4accb4e23..5a61ef22f07b4338844220b0f6fc89a2dc505ef4 100644 --- a/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/control/treetableview/.ratings +++ b/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/control/treetableview/.ratings @@ -1,6 +1,6 @@ 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 diff --git a/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/control/treetableview/DynamicTreeTableUIProviderBase.java b/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/control/treetableview/DynamicTreeTableUIProviderBase.java index b9e68bede4ad0763e4ea3d3c1e7edeb0d63ed261..4adb4066bdd8eac75f7b8a4ba7aa5d42b43d8e32 100644 --- a/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/control/treetableview/DynamicTreeTableUIProviderBase.java +++ b/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/control/treetableview/DynamicTreeTableUIProviderBase.java @@ -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);