Changed options not showing node counts on disabled nodes.

This commit is contained in:
leriomaggio
2021-07-05 09:35:02 +01:00
parent a276118409
commit dab893c24f

View File

@@ -491,7 +491,7 @@ public class FCheckBoxTree extends JTree {
String chkBoxTxt = nodeInfo.label;
int disabledNodes = cn.numberOfChildren - cn.enabledChildrenCount;
int totalActiveNodes = cn.numberOfChildren - disabledNodes;
if (this.displayNodesCount && !node.isLeaf() && cn.numberOfChildren > 0) {
if (this.displayNodesCount && !node.isLeaf() && cn.numberOfChildren > 0 && totalActiveNodes > 0) {
chkBoxTxt += String.format(" (%d/%d)", cn.selectedChildrenCount, totalActiveNodes);;
}
this.checkBox.setText(chkBoxTxt);