by ack1035 » Tue Jun 10, 2008 12:05 pm
I emailed the modified code, which reproduced the following results:
-word wrap is now enabled, but
-items in the subtables that formerly had children no longer do ("ComboBox" and "CellEditors")
Here's an excerpt to show how I did this (around line 139):
TableModel model = ((TableModel) value);
if (model instanceof HierarchicalTableModel) {
HierarchicalTable childTable = new HierarchicalTable(model) {
@Override
public void scrollRectToVisible(Rectangle aRect) {
HierarchicalTableDemo.scrollRectToVisible(this, aRect);
}
TableCellRenderer cellRenderer =
new MultilineTableCellRenderer();
@Override
public TableCellRenderer getCellRenderer(int row, int column) {
return cellRenderer;
}
};
childTable.setRowAutoResizes(true);
...
The behavior I'd like is to have both the word wrap and not to lose subtables.
Thanks,
Alex