Fixed issue with GTreeModel's fireNodeChanged() method not actually

telling the tree which node changed.
This commit is contained in:
ghidravore 2020-07-20 16:13:09 -04:00
parent 817052c94c
commit 4d48d6f180

View File

@ -158,7 +158,15 @@ public class GTreeModel implements TreeModel {
SystemUtilities.assertThisIsTheSwingThread(
"GTreeModel.fireNodeDataChanged() must be " + "called from the AWT thread");
TreeModelEvent event = new TreeModelEvent(this, (TreePath) null);
GTreeNode viewNode = convertToViewNode(changedNode);
if (viewNode == null) {
return;
}
// Note - we are passing in the treepath of the node that changed. The javadocs in
// TreemodelListener seems to imply that you need to pass in the treepath of the parent
// of the node that changed and then the indexes of the children that changed. But this
// works and is cheaper then computing the index of the node that changed.
TreeModelEvent event = new TreeModelEvent(this, viewNode.getTreePath());
for (TreeModelListener listener : listeners) {
listener.treeNodesChanged(event);