JXTreeTable response to TreeStructureChanged() surprising, calls TableDataChanged()
So this is a thread to report some very strange behavior I found in JXTreeTable, which is making a project that I'm working on very difficult. Of course, if there's a case to be made that this behavior in fact makes sense and there is some other way to do what I am trying to do, then I would welcome someone to point this out.
It seems that this issue was reported and discussed in 2007:
(EDIT: I just skimmed this thread again, and noticed that the issue reported was the *opposite* of the one that I'm reporting, the user wanted to report a change in the number of columns, but didn't know how to do this except to call treeStructureChanged(), and noticed that this did not trigger "table structure changed", but there is a long discussion on the thread that overlaps some of the issues here, but the solution to have it trigger a table data change event I think is wrong for the reasons I describe below)
The issue is that if a treeStructureChanged() event is sent by the model to a JXTreeTable, the JXTreeTable at least some of the time triggers a JTable "table structure changed" event to implement this. The problem is that "table structure changed" causes column editors and renderers to be reset to the defaults. The fact that this has not been fixed in all this time makes me think that apparently not many people have run in to this issue, but in my application, where the tree table uses custom editors/renderers, and the structure can change in response to user event, the issue is really obvious.
It seems to me that the way to solve this is to modify the implementation of a treeStructureChanged() event so that it does not trigger "table structure changed" in the JTable. It seems like this should be possible since I believe that JTable supports events for rows added/deleted which does not reset all the columns. If the user actually does want the columns reset, there should be a different event for that.
Because I'm having to modify legacy code committed to JXTreeTable, probably I'll have to hack something around this problem. If someone sees something that I've missed and would like to point it out, I would definitely appreciate it. However, currently to me this seems like a significant problem for applications like those that I am working on.
Thanks in advance!