protected boolean toggleNode(CheckedTreeNode node) {
    boolean checked = !node.isChecked();
    checkNode(node, checked);

    // notify model listeners about model change
    final TreeModel model = getTree().getModel();
    model.valueForPathChanged(new TreePath(node.getPath()), node.getUserObject());

    return checked;
  }
 public void valueForPathChanged(TreePath path, Object newValue) {
   model.valueForPathChanged(path, newValue);
 }