I have a JXTreeTable for which data model extends DefaultTreeTableModel, and CustomNode extends AbstractMutableTreeTableNode. Each column is editable as expected, as well as hierarchical tree node.
How to apply custom editor (TreeTableCellEditor) to hierarchical column in JXTreeTable?
The following were several attempts, yet yielded not expected results:
treeTable.setCellEditor(editor)
treeTable.getColumnModel().getColumn(0).setCellEditor(editor)
treeTable.getColumn(0).setCellEditor(editor)
treeTable.getColumnExt(0).setCellEditor(editor)
I was able to get the inherent tree used for rendering the hierarchical column, but also unable to specify custom editor through it.
private JTree getTree(JXTreeTable treeTable){
try{
Field field = JXTreeTable.class.getDeclaredField("renderer");
field.setAccessible(true);
return (JTree)field.get(treeTable);
}catch(NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException ex){
throw new RuntimeException(ex);
}
}
It seems that there were a "workaround" that was posted previsouly but I am not able to access to the page content: http://forums.java.net/jive/message.jspa?messageID=387603 (in https://java.net/projects/swingx/lists/issues/archive/2012-06/message/22)
Any clue to specify custom editor to tree column?
Thank you very much for your feedback.